Skip to content

Commit

Permalink
Add SYSTEM keyword to external dependency include directories
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Mar 23, 2020
1 parent 7e0e967 commit 89b14cd
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 18 deletions.
3 changes: 2 additions & 1 deletion cmake/HPX_GeneratePackageUtils.cmake
Expand Up @@ -167,8 +167,9 @@ function(hpx_construct_cflag_list compile_definitions compile_options pic_option
"${_cflag_list} $<JOIN:${${compile_options}}, >")
set(_cflag_list
"${_cflag_list} $<$<BOOL:${${include_directories}}>:-I$<JOIN:${${include_directories}}, -I>>")
# NOTE: This uses -I and not -isystem in lack of a good way to filter out compiler search paths.
set(_cflag_list
"${_cflag_list} $<$<BOOL:${${sys_include_dirs}}>:-isystem$<JOIN:${${sys_include_dirs}}, -isystem>>")
"${_cflag_list} $<$<BOOL:${${sys_include_dirs}}>:-I$<JOIN:${${sys_include_dirs}}, -isystem>>")
set(${cflag_list} ${_cflag_list} PARENT_SCOPE)

endfunction(hpx_construct_cflag_list)
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupAllocator.cmake
Expand Up @@ -119,7 +119,7 @@ if (NOT TARGET hpx::allocator)
endif()

add_library(hpx::amplifier INTERFACE IMPORTED)
target_include_directories(hpx::amplifier INTERFACE ${AMPLIFIER_INCLUDE_DIR})
target_include_directories(hpx::amplifier SYSTEM INTERFACE ${AMPLIFIER_INCLUDE_DIR})
target_link_libraries(hpx::amplifier INTERFACE ${AMPLIFIER_LIBRARIES})

hpx_add_config_define(HPX_HAVE_ITTNOTIFY 1)
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupApex.cmake
Expand Up @@ -62,7 +62,7 @@ if(HPX_WITH_APEX AND NOT TARGET hpx::apex)
endif()

add_library(hpx::ittnotify INTERFACE IMPORTED)
target_include_directories(hpx::ittnotify INTERFACE ${ITTNOTIFY_SOURCE_DIR})
target_include_directories(hpx::ittnotify SYSTEM INTERFACE ${ITTNOTIFY_SOURCE_DIR})
target_link_libraries(hpx::apex INTERFACE hpx::ittnotify)
hpx_add_config_define(HPX_HAVE_ITTNOTIFY 1)
endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/HPX_SetupBoost.cmake
Expand Up @@ -85,10 +85,10 @@ if (NOT TARGET hpx::boost)
# Boost headers
# FIXME: push changes upstream
if(HPX_PLATFORM_UC STREQUAL "XEONPHI")
target_include_directories(hpx::boost BEFORE INTERFACE ${PROJECT_SOURCE_DIR}/external/asio)
target_include_directories(hpx::boost SYSTEM BEFORE INTERFACE ${PROJECT_SOURCE_DIR}/external/asio)
endif()

target_include_directories(hpx::boost INTERFACE ${Boost_INCLUDE_DIRS})
target_include_directories(hpx::boost SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(hpx::boost INTERFACE ${Boost_LIBRARIES})

include(HPX_AddDefinitions)
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupBoostFilesystem.cmake
Expand Up @@ -19,7 +19,7 @@ if(HPX_FILESYSTEM_WITH_BOOST_FILESYSTEM_COMPATIBILITY)
COMPONENTS filesystem)

add_library(hpx::boost::filesystem INTERFACE IMPORTED)
target_include_directories(hpx::boost::filesystem INTERFACE ${Boost_INCLUDE_DIRS})
target_include_directories(hpx::boost::filesystem SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(hpx::boost::filesystem INTERFACE ${Boost_FILESYSTEM_LIBRARIES})

endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupBoostIostreams.cmake
Expand Up @@ -18,7 +18,7 @@ if(NOT TARGET hpx::boost::iostreams)

add_library(hpx::boost::iostreams INTERFACE IMPORTED)

target_include_directories(hpx::boost::iostreams INTERFACE ${Boost_INCLUDE_DIRS})
target_include_directories(hpx::boost::iostreams SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(hpx::boost::iostreams INTERFACE ${Boost_IOSTREAMS_LIBRARIES})

endif()
2 changes: 1 addition & 1 deletion cmake/HPX_SetupBoostProgramOptions.cmake
Expand Up @@ -25,7 +25,7 @@ if(HPX_PROGRAM_OPTIONS_WITH_BOOST_PROGRAM_OPTIONS_COMPATIBILITY AND NOT TARGET
endif()

add_library(hpx::boost::program_options INTERFACE IMPORTED)
target_include_directories(hpx::boost::program_options INTERFACE ${Boost_INCLUDE_DIRS})
target_include_directories(hpx::boost::program_options SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(hpx::boost::program_options INTERFACE
${Boost_PROGRAM_OPTIONS_LIBRARIES})

Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupBoostRegex.cmake
Expand Up @@ -18,6 +18,6 @@ if(NOT TARGET hpx::boost::regex)
endif()

add_library(hpx::boost::regex INTERFACE IMPORTED)
target_include_directories(hpx::boost::regex INTERFACE ${Boost_INCLUDE_DIRS})
target_include_directories(hpx::boost::regex SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(hpx::boost::regex INTERFACE ${Boost_REGEX_LIBRARIES})
endif()
2 changes: 1 addition & 1 deletion cmake/HPX_SetupGooglePerfTools.cmake
Expand Up @@ -23,7 +23,7 @@ if(HPX_WITH_GOOGLE_PERFTOOLS AND NOT TARGET hpx::gperftools)
endif()

add_library(hpx::gperftools INTERFACE IMPORTED)
target_include_directories(hpx::gperftools INTERFACE ${GOOGLE_PERFTOOLS_INCLUDE_DIR})
target_include_directories(hpx::gperftools SYSTEM INTERFACE ${GOOGLE_PERFTOOLS_INCLUDE_DIR})
target_link_libraries(hpx::gperftools INTERFACE ${GOOGLE_PERFTOOLS_LIBRARIES})

endif()
2 changes: 1 addition & 1 deletion cmake/HPX_SetupHwloc.cmake
Expand Up @@ -21,7 +21,7 @@ if (NOT TARGET hpx::hwloc)
endif()

add_library(hpx::hwloc INTERFACE IMPORTED)
target_include_directories(hpx::hwloc INTERFACE ${HWLOC_INCLUDE_DIR})
target_include_directories(hpx::hwloc SYSTEM INTERFACE ${HWLOC_INCLUDE_DIR})
target_link_libraries(hpx::hwloc INTERFACE ${HWLOC_LIBRARIES})

endif()
4 changes: 2 additions & 2 deletions cmake/HPX_SetupLibfabric.cmake
Expand Up @@ -23,7 +23,7 @@ if (HPX_WITH_PARCELPORT_LIBFABRIC AND NOT TARGET hpx::libfabric)
endif()
# Setup Libfabric imported target
add_library(hpx::libfabric INTERFACE IMPORTED)
target_include_directories(hpx::libfabric INTERFACE ${LIBFABRIC_INCLUDE_DIR})
target_include_directories(hpx::libfabric SYSTEM INTERFACE ${LIBFABRIC_INCLUDE_DIR})
target_link_libraries(hpx::libfabric INTERFACE ${LIBFABRIC_LIBRARY})

# Setup PMI imported target
Expand All @@ -35,7 +35,7 @@ if (HPX_WITH_PARCELPORT_LIBFABRIC AND NOT TARGET hpx::libfabric)
endif()

add_library(hpx::pmi INTERFACE IMPORTED)
target_include_directories(hpx::pmi INTERFACE ${PMI_INCLUDE_DIR})
target_include_directories(hpx::pmi SYSTEM INTERFACE ${PMI_INCLUDE_DIR})
target_link_libraries(hpx::pmi INTERFACE ${PMI_LIBRARY})

#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupMPI.cmake
Expand Up @@ -19,7 +19,7 @@ if(HPX_WITH_NETWORKING AND HPX_WITH_PARCELPORT_MPI AND NOT TARGET hpx::mpi)
MPI_ROOT to point to the root of your MPI installation")
endif()
add_library(hpx::mpi INTERFACE IMPORTED)
target_include_directories(hpx::mpi INTERFACE ${MPI_INCLUDE_PATH} ${MPI_CXX_INCLUDE_DIRS})
target_include_directories(hpx::mpi SYSTEM INTERFACE ${MPI_INCLUDE_PATH} ${MPI_CXX_INCLUDE_DIRS})
# MPI_LIBRARY and EXTRA is deprecated but still linked for older MPI versions
if (MPI_CXX_LIBRARIES)
target_link_libraries(hpx::mpi INTERFACE ${MPI_CXX_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupPapi.cmake
Expand Up @@ -21,6 +21,6 @@ if(HPX_WITH_PAPI AND NOT TARGET hpx::papi)
PAPI_ROOT to point to the root of your PAPI installation")
endif()
add_library(hpx::papi INTERFACE IMPORTED)
target_include_directories(hpx::papi INTERFACE ${PAPI_INCLUDE_DIR})
target_include_directories(hpx::papi SYSTEM INTERFACE ${PAPI_INCLUDE_DIR})
target_link_libraries(hpx::papi INTERFACE ${PAPI_LIBRARY})
endif()
2 changes: 1 addition & 1 deletion cmake/HPX_SetupValgrind.cmake
Expand Up @@ -22,7 +22,7 @@ if(HPX_WITH_VALGRIND AND NOT TARGET hpx::valgrind)
endif()

add_library(hpx::valgrind INTERFACE IMPORTED)
target_include_directories(hpx::valgrind INTERFACE ${VALGRIND_INCLUDE_DIR})
target_include_directories(hpx::valgrind SYSTEM INTERFACE ${VALGRIND_INCLUDE_DIR})

hpx_add_config_define(HPX_HAVE_VALGRIND)
endif()
2 changes: 1 addition & 1 deletion cmake/HPX_SetupVc.cmake
Expand Up @@ -56,7 +56,7 @@ if(HPX_WITH_DATAPAR_VC AND NOT TARGET hpx::vc)
endif()

add_library(hpx::vc INTERFACE IMPORTED)
target_include_directories(hpx::vc INTERFACE ${Vc_INCLUDE_DIR})
target_include_directories(hpx::vc SYSTEM INTERFACE ${Vc_INCLUDE_DIR})

if(NOT HPX_WITH_DATAPAR_VC_NO_LIBRARY)
target_link_libraries(hpx::vc INTERFACE ${Vc_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion cmake/HPX_SetupVerbs.cmake
Expand Up @@ -215,7 +215,7 @@ if (HPX_WITH_PARCELPORT_VERBS AND NOT TARGET hpx::verbs)
include(HPX_AddLibrary)

add_library(hpx::verbs INTERFACE IMPORTED)
target_include_directories(hpx::verbs INTERFACE ${IB_VERBS_INCLUDE_DIRS} ${RDMA_CM_INCLUDE_DIRS})
target_include_directories(hpx::verbs SYSTEM INTERFACE ${IB_VERBS_INCLUDE_DIRS} ${RDMA_CM_INCLUDE_DIRS})
target_link_libraries(hpx::verbs INTERFACE ${IB_VERBS_LIBRARIES} ${RDMA_CM_LIBRARIES})

endif()

0 comments on commit 89b14cd

Please sign in to comment.