Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Allow to specify CATCH_CONFIG_DEFAULT_REPORTER for static library with main() (#2346)

Commit
958944d27a2d2fb82aa008377bf4f8752f6b848e
Author
Mikhail Matrosov ·
Committer
GitHub
Parents
216713a4066b

Files · Download .tar.gz

Changes

 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3db32a53..c0dfb09b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,6 +116,10 @@ if (CATCH_BUILD_STATIC_LIBRARY)
      ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 10))
     target_compile_options(Catch2WithMain PRIVATE "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
   endif()
+
+  if (CATCH_CONFIG_DEFAULT_REPORTER) 
+    target_compile_definitions(Catch2WithMain PRIVATE CATCH_CONFIG_DEFAULT_REPORTER=${CATCH_CONFIG_DEFAULT_REPORTER})
+  endif()
 endif(CATCH_BUILD_STATIC_LIBRARY)
 
 # Only perform the installation steps when Catch is not being used as