From 41c386621879abdd0356d7a85ee46b8b09f526fd Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 11 Sep 2024 00:24:25 +0200 Subject: [PATCH] [INFRA] Also include library for -Wnrvo --- test/hibf-test.cmake | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/test/hibf-test.cmake b/test/hibf-test.cmake index 6427c312..b53ee416 100644 --- a/test/hibf-test.cmake +++ b/test/hibf-test.cmake @@ -17,6 +17,13 @@ get_filename_component (HIBF_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) add_subdirectory ("${HIBF_ROOT_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/hibf_lib") target_compile_options (hibf PUBLIC "-pedantic" "-Wall" "-Wextra" "-Werror") +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # Warn about failed return value optimization. + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14) + target_compile_options (hibf PUBLIC "-Wnrvo") + endif () +endif () + set (CPM_INDENT " CMake Package Manager CPM: ") CPMUsePackageLock ("${HIBF_ROOT_DIR}/cmake/package-lock.cmake") @@ -43,17 +50,6 @@ enable_testing () if (NOT TARGET hibf::test) add_library (hibf_test INTERFACE) - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - # Disable warning about std::hardware_destructive_interference_size not being ABI-stable. - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) - target_compile_options (hibf_test INTERFACE "-Wno-interference-size") - endif () - # Warn about failed return value optimization. - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14) - target_compile_options (hibf_test INTERFACE "-Wnrvo") - endif () - endif () - target_link_libraries (hibf_test INTERFACE "seqan::hibf") target_include_directories (hibf_test INTERFACE "${HIBF_TEST_INCLUDE_DIR}") add_library (hibf::test ALIAS hibf_test)