diff --git a/CMakeLists.txt b/CMakeLists.txt index 164a7dca..f348d0ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,13 +15,22 @@ project(etl VERSION ${ETL_VERSION}) option(BUILD_TESTS "Build unit tests" OFF) option(NO_STL "No STL" OFF) +# There is a bug on old gcc versions for some targets that causes all system headers +# to be implicitly wrapped with 'extern "C"' +# Users can add set(NO_SYSTEM_INCLUDE ON) to their top level CMakeLists.txt to work around this. +option(NO_SYSTEM_INCLUDE "Do not include with -isystem" OFF) +if (NO_SYSTEM_INCLUDE) + set(INCLUDE_SPECIFIER "") +else() + set(INCLUDE_SPECIFIER "SYSTEM") +endif() add_library(${PROJECT_NAME} INTERFACE) # This allows users which use the add_subdirectory or FetchContent # to use the same target as users which use find_package add_library(etl::etl ALIAS ${PROJECT_NAME}) -target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE +target_include_directories(${PROJECT_NAME} ${INCLUDE_SPECIFIER} INTERFACE $ $ )