Skip to content
Merged
Changes from 2 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
15 changes: 6 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ FetchContent_Declare(
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.10.0
GIT_TAG v3.13.0
Comment thread
knoepfel marked this conversation as resolved.
GIT_SHALLOW ON
EXCLUDE_FROM_ALL # Do not install
FIND_PACKAGE_ARGS
Expand Down Expand Up @@ -90,6 +90,11 @@ set(CTEST_TEST_TIMEOUT 90 CACHE STRING "Per-test timeout (s) for CTest")
# Make tools available
FetchContent_MakeAvailable(Catch2 GSL mimicpp)

# Suppress Catch2's use of __COUNTER__ (a compiler extension, not standard C++)
# by propagating CATCH_CONFIG_NO_COUNTER to all consumers of Catch2::Catch2,
# regardless of whether Catch2 was resolved via find_package or FetchContent.
target_compile_definitions(Catch2::Catch2 INTERFACE CATCH_CONFIG_NO_COUNTER)

Comment thread
knoepfel marked this conversation as resolved.
Outdated
include(Modules/private/CreateCoverageTargets.cmake)

option(ENABLE_TSAN "Enable Thread Sanitizer" OFF)
Expand Down Expand Up @@ -136,14 +141,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()
endif()

# Catch2's TEST_CASE macro uses __COUNTER__, which Clang >= 22 flags as a C2y
# extension under -pedantic. Suppress the warning to avoid -Werror failures.
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "22")
add_compile_options(-Wno-c2y-extensions)
endif()
endif()

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)

Expand Down
Loading