Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INFRA] Update dependencies and add -Wnrvo #228

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set (CPM_DOWNLOAD_VERSION 0.38.6)
set (CPM_HASH_SUM "11c3fa5f1ba14f15d31c2fb63dbc8628ee133d81c8d764caad9a8db9e0bacb07")
set (CPM_DOWNLOAD_VERSION 0.40.2)
set (CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")

if (CPM_SOURCE_CACHE)
set (CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
Expand Down
10 changes: 5 additions & 5 deletions cmake/package-lock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ CPMDeclarePackage (cereal
SYSTEM TRUE
OPTIONS "JUST_INSTALL_CEREAL ON")
# simde
set (HIBF_SIMDE_VERSION 0.7.6)
set (HIBF_SIMDE_VERSION 0.8.2)
CPMDeclarePackage (simde
NAME simde
VERSION ${HIBF_SIMDE_VERSION}
DOWNLOAD_ONLY YES
GITHUB_REPOSITORY simd-everywhere/simde)
# benchmark
set (HIBF_BENCHMARK_VERSION 1.8.4)
set (HIBF_BENCHMARK_VERSION 1.9.0)
CPMDeclarePackage (benchmark
NAME benchmark
VERSION ${HIBF_BENCHMARK_VERSION}
GITHUB_REPOSITORY google/benchmark
SYSTEM TRUE
OPTIONS "BENCHMARK_ENABLE_TESTING OFF" "BENCHMARK_ENABLE_WERROR OFF")
# googletest
set (HIBF_GOOGLETEST_VERSION 1.14.0)
set (HIBF_GOOGLETEST_VERSION 1.15.1)
CPMDeclarePackage (googletest
NAME GTest
NAME googletest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With newer CMake versions, some variables clash.
The googletest CMake project is (also) called gtest.

VERSION ${HIBF_GOOGLETEST_VERSION}
GITHUB_REPOSITORY google/googletest
SYSTEM TRUE
OPTIONS "BUILD_GMOCK OFF" "INSTALL_GTEST OFF" "CMAKE_CXX_STANDARD 20")
# doxygen-awesome
set (HIBF_DOXYGEN_AWESOME_VERSION 2.3.2)
set (HIBF_DOXYGEN_AWESOME_VERSION 2.3.3)
CPMDeclarePackage (doxygen_awesome
NAME doxygen_awesome
VERSION ${HIBF_DOXYGEN_AWESOME_VERSION}
Expand Down
15 changes: 5 additions & 10 deletions test/hibf-test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ enable_testing ()
if (NOT TARGET hibf::test)
add_library (hibf_test INTERFACE)

# GCC12 and above: Disable warning about std::hardware_destructive_interference_size not being ABI-stable.
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")
Expand All @@ -72,15 +76,6 @@ endif ()
# needed for unit test cases in hibf/test/unit
if (NOT TARGET hibf::test::unit)
add_library (hibf_test_unit INTERFACE)

# GCC12 has some bogus warnings. They will not be fixed in googletest.
# https://github.com/google/googletest/issues/4232
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
target_compile_options (hibf_test INTERFACE "-Wno-restrict")
endif ()
endif ()

target_link_libraries (hibf_test_unit INTERFACE "hibf::test" "GTest::gtest_main")
add_library (hibf::test::unit ALIAS hibf_test_unit)
endif ()
Expand Down
15 changes: 9 additions & 6 deletions test/include/hibf/test/type_name_as_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ inline std::string const type_name_as_string = []()
// itself, since the type is directly given by the compiler.
// LCOV_EXCL_START
if (status != 0)
return std::string{typeid(type).name()} + " (abi::__cxa_demangle error status (" + std::to_string(status)
+ "): "
+ (status == -1 ? "A memory allocation failure occurred."
: (status == -2 ? "mangled_name is not a valid name under the C++ ABI mangling rules."
: (status == -3 ? "One of the arguments is invalid." : "Unknown Error")))
+ ")";
{
demangled_name =
std::string{typeid(type).name()} + " (abi::__cxa_demangle error status (" + std::to_string(status) + "): "
+ (status == -1 ? "A memory allocation failure occurred."
: (status == -2 ? "mangled_name is not a valid name under the C++ ABI mangling rules."
: (status == -3 ? "One of the arguments is invalid." : "Unknown Error")))
+ ")";
return demangled_name;
}
// LCOV_EXCL_STOP

demangled_name = std::string{std::addressof(*demangled_name_ptr)};
Expand Down
Loading