Skip to content

Commit

Permalink
replace catch2 submodule with fetchcontent
Browse files Browse the repository at this point in the history
  • Loading branch information
bmario committed Apr 30, 2024
1 parent f77cf44 commit e42648e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ if(MSVC)
endif()

include(cmake/GitSubmoduleUpdate.cmake)
git_submodule_update()

if(Git_FOUND)
_is_git(${CMAKE_CURRENT_SOURCE_DIR} IN_GIT)
Expand Down
12 changes: 8 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ macro(NitroTest TEST)
add_test(${TEST_NAME} ${TEST_NAME})
endmacro()

add_library(catch2 INTERFACE)
target_include_directories(catch2 SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Catch/single_include)
add_library(Catch2::Catch2 ALIAS catch2)
include(FetchContent)
FetchContent_Declare(Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.10
FIND_PACKAGE_ARGS
)
FetchContent_MakeAvailable(Catch2)

add_library(nitro_test_main OBJECT catch_main.cpp)
target_include_directories(nitro_test_main SYSTEM PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Catch/single_include)
target_compile_features(nitro_test_main
PRIVATE
cxx_auto_type
Expand All @@ -46,6 +49,7 @@ target_compile_features(nitro_test_main
cxx_variadic_templates
cxx_template_template_parameters
)
target_link_libraries(nitro_test_main PUBLIC Catch2::Catch2)

if(NOT CMAKE_C_COMPILER_ID MATCHES "MSVC")
add_library(nitro_test_lib SHARED nitro_test_lib.cpp)
Expand Down
1 change: 0 additions & 1 deletion tests/Catch
Submodule Catch deleted from 7c9f92

0 comments on commit e42648e

Please sign in to comment.