build: all FetchContent packages should be SYSTEM

This commit is contained in:
Marcus Holland-Moritz 2024-10-19 21:06:50 +02:00
parent 8966e86c1d
commit 2d86ae4fc1
6 changed files with 10 additions and 6 deletions

View File

@ -503,7 +503,7 @@ if(WITH_TESTS)
### include paths are searched first.
get_target_property(gmock_include_dirs gmock INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(gtest_include_dirs gtest INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(${test} PRIVATE BEFORE ${gmock_include_dirs} ${gtest_include_dirs})
target_include_directories(${test} SYSTEM PRIVATE BEFORE ${gmock_include_dirs} ${gtest_include_dirs})
endif()
target_compile_definitions(${test}
@ -597,7 +597,7 @@ if(WITH_LIBDWARFS AND WITH_FUZZ)
endif()
foreach(tgt ${LIBDWARFS_TARGETS})
target_include_directories(${tgt} PRIVATE
target_include_directories(${tgt} SYSTEM PRIVATE
$<BUILD_INTERFACE:$<TARGET_PROPERTY:phmap,INTERFACE_INCLUDE_DIRECTORIES>>
)
endforeach()
@ -626,7 +626,7 @@ foreach(tgt ${LIBDWARFS_TARGETS} ${LIBDWARFS_OBJECT_TARGETS} dwarfs_test_helpers
$<INSTALL_INTERFACE:include>
)
target_include_directories(${tgt} PUBLIC
target_include_directories(${tgt} SYSTEM PUBLIC
$<BUILD_INTERFACE:$<TARGET_PROPERTY:range-v3::range-v3,INTERFACE_INCLUDE_DIRECTORIES>>
)

View File

@ -26,6 +26,7 @@ if(NOT fmt_FOUND)
GIT_REPOSITORY ${LIBFMT_GIT_REPO}
GIT_TAG ${LIBFMT_PREFERRED_VERSION}
EXCLUDE_FROM_ALL
SYSTEM
)
FetchContent_MakeAvailable(fmt)
endif()
@ -35,5 +36,5 @@ if(fmt_FOUND OR STATIC_BUILD_DO_NOT_USE OR WIN32)
set(DWARFS_FMT_LIB fmt::fmt)
else()
add_compile_definitions(FMT_HEADER_ONLY)
include_directories($<BUILD_INTERFACE:$<TARGET_PROPERTY:fmt::fmt-header-only,INTERFACE_INCLUDE_DIRECTORIES>>)
include_directories(SYSTEM $<BUILD_INTERFACE:$<TARGET_PROPERTY:fmt::fmt-header-only,INTERFACE_INCLUDE_DIRECTORIES>>)
endif()

View File

@ -41,6 +41,7 @@ else()
GIT_REPOSITORY ${GOOGLETEST_GIT_REPO}
GIT_TAG v${GOOGLETEST_PREFERRED_VERSION}
EXCLUDE_FROM_ALL
SYSTEM
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

View File

@ -46,6 +46,7 @@ else()
GIT_REPOSITORY ${PARALLEL_HASHMAP_GIT_REPO}
GIT_TAG v${PARALLEL_HASHMAP_PREFERRED_VERSION}
EXCLUDE_FROM_ALL
SYSTEM
)
FetchContent_MakeAvailable(parallel-hashmap)
endif()

View File

@ -26,6 +26,7 @@ if(NOT range-v3_FOUND)
GIT_REPOSITORY ${RANGE_V3_GIT_REPO}
GIT_TAG ${RANGE_V3_PREFERRED_VERSION}
EXCLUDE_FROM_ALL
SYSTEM
)
FetchContent_MakeAvailable(range-v3)
endif()

View File

@ -70,7 +70,7 @@ foreach(target ${RICEPP_LIBS_CPUSPECIFIC})
message(STATUS "[ricepp] adding CPU target: ${target}")
target_include_directories(${target} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
# target_link_libraries(${target} PUBLIC range-v3::range-v3)
target_include_directories(${target} PUBLIC
target_include_directories(${target} SYSTEM PUBLIC
$<BUILD_INTERFACE:$<TARGET_PROPERTY:range-v3::range-v3,INTERFACE_INCLUDE_DIRECTORIES>>
)
target_compile_features(${target} PUBLIC cxx_std_20)
@ -80,7 +80,7 @@ endforeach()
add_library(ricepp-core OBJECT ricepp.cpp)
# target_link_libraries(ricepp-core PUBLIC range-v3::range-v3)
target_include_directories(ricepp-core PUBLIC
target_include_directories(ricepp-core SYSTEM PUBLIC
$<BUILD_INTERFACE:$<TARGET_PROPERTY:range-v3::range-v3,INTERFACE_INCLUDE_DIRECTORIES>>
)
target_include_directories(ricepp-core PUBLIC