Skip to content

Commit

Permalink
Merge pull request #229 from eseiler/infra/wnrvo
Browse files Browse the repository at this point in the history
[INFRA] Also include library for -Wnrvo
  • Loading branch information
eseiler authored Sep 10, 2024
2 parents 64260e9 + 41c3866 commit 485b22b
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 485b22b

Please sign in to comment.