Skip to content

Commit

Permalink
Tests: require newer catch2 version when using c++20, get latest catc…
Browse files Browse the repository at this point in the history
…h2 v3 version for internal
  • Loading branch information
andresailer committed Aug 21, 2023
1 parent d32469e commit d206b10
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
if(CMAKE_CXX_STANDARD GREATER_EQUAL 20)
set(CATCH2_MIN_VERSION 3.4)
else()
set(CATCH2_MIN_VERSION 3.1)
endif()
if(USE_EXTERNAL_CATCH2)
if (USE_EXTERNAL_CATCH2 STREQUAL AUTO)
find_package(Catch2 3.1)
find_package(Catch2 ${CATCH2_MIN_VERSION})
else()
find_package(Catch2 3.1 REQUIRED)
find_package(Catch2 ${CATCH2_MIN_VERSION} REQUIRED)
endif()
endif()

Expand All @@ -16,7 +21,7 @@ if(NOT Catch2_FOUND)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.1.0
GIT_TAG v3.4.0
)
FetchContent_MakeAvailable(Catch2)
set(CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras ${CMAKE_MODULE_PATH})
Expand Down

0 comments on commit d206b10

Please sign in to comment.