mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
Added Catch v3 support. (#2656)
This commit is contained in:
@@ -13,6 +13,20 @@ if(PkgConfig_FOUND)
|
||||
pkg_check_modules(systemd libsystemd)
|
||||
endif()
|
||||
|
||||
find_package(Catch2 3 QUIET)
|
||||
if (Catch2_FOUND)
|
||||
message(STATUS "Packaged version of Catch will be used.")
|
||||
else()
|
||||
message(STATUS "Bundled version of Catch will be downloaded and used.")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.3.2
|
||||
)
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
endif()
|
||||
|
||||
set(SPDLOG_UTESTS_SOURCES
|
||||
test_file_helper.cpp
|
||||
test_file_logging.cpp
|
||||
@@ -53,6 +67,7 @@ function(spdlog_prepare_test test_target spdlog_lib)
|
||||
if(systemd_FOUND)
|
||||
target_link_libraries(${test_target} PRIVATE ${systemd_LIBRARIES})
|
||||
endif()
|
||||
target_link_libraries(${test_target} PRIVATE Catch2::Catch2WithMain)
|
||||
if(SPDLOG_SANITIZE_ADDRESS)
|
||||
spdlog_enable_sanitizer(${test_target})
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user