Skip to content

Commit

Permalink
[INFRA] Also include library for -Wnrvo
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Sep 10, 2024
1 parent 64260e9 commit 41c3866
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions test/hibf-test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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)
Expand Down

0 comments on commit 41c3866

Please sign in to comment.