Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-12-15 20:33:39 +0100
committerMartin Hořeňovský2019-12-15 20:33:39 +0100
commit5fbf04cd59ab2e082411ac2fb1aeb4fc97451ef4 (patch)
treebf8ee809ce4914f4a01a1f84fa3ea13d53d7d11e /src
parent8b42acc328fc7b6c4526e649a30c4b3c198c974d (diff)
downloadcatch3-5fbf04cd59ab2e082411ac2fb1aeb4fc97451ef4.tar.gz
Redo how the separate compilation tests are handled
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 227943b7..eeef8f31 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -230,19 +230,20 @@ target_include_directories(Catch2
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
-function(StampOutLibrary target)
- add_library(Catch2_${target} STATIC
+# Some tests require a full recompilation of Catch2 lib with different
+# compilation flags. They can link against this target to recompile all
+# the sources into the binary.
+if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS)
+ add_library(Catch2_buildall_interface INTERFACE)
+ target_sources(Catch2_buildall_interface INTERFACE
${REPORTER_FILES}
${INTERNAL_FILES}
${BENCHMARK_HEADERS}
${BENCHMARK_SOURCES}
)
-
- target_include_directories(Catch2_${target}
- PUBLIC
+ target_include_directories(Catch2_buildall_interface
+ INTERFACE
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
-
- target_link_libraries(${target} Catch2_${target})
-endfunction()
+endif()