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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJan Palus2023-12-28 00:41:54 +0100
committerJan Palus2023-12-28 00:41:54 +0100
commit1512dac7e4c2fddadcc15f7ab316ce3d5b67e7f3 (patch)
treea1ae688393c11f2b21f3119dbfd68f37611ddbd7
parentcd3c7ebe873c3da91ce57c6b2221ba95ee7f93e6 (diff)
downloadcatch3-1512dac7e4c2fddadcc15f7ab316ce3d5b67e7f3.tar.gz
Make compiler flags for reproducible builds optional
no change in default behavior: -ffile-prefix-map is still added if supported by compiler but add option for disabling it as it breaks generic tools for extracting debuginfo/debugsource from build artifacts like: https://sourceware.org/git/?p=debugedit.git;a=blob;f=scripts/find-debuginfo.in
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/CMakeLists.txt8
2 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2cfb6cd1..20e4036e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,7 @@ endif()
option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)
option(CATCH_INSTALL_EXTRAS "Install extras (CMake scripts, debugger helpers) alongside library" ON)
option(CATCH_DEVELOPMENT_BUILD "Build tests, enable warnings, enable Werror, etc" OFF)
+option(CATCH_ENABLE_REPRODUCIBLE_BUILD "Add compiler flags for improving build reproducibility" ON)
include(CMakeDependentOption)
cmake_dependent_option(CATCH_BUILD_TESTING "Build the SelfTest project" ON "CATCH_DEVELOPMENT_BUILD" OFF)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d01aab2d..eb805ddd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -348,7 +348,9 @@ source_group("generated headers"
)
add_library(Catch2 ${ALL_FILES})
-add_build_reproducibility_settings(Catch2)
+if (CATCH_ENABLE_REPRODUCIBLE_BUILD)
+ add_build_reproducibility_settings(Catch2)
+endif()
add_library(Catch2::Catch2 ALIAS Catch2)
if (ANDROID)
@@ -401,7 +403,9 @@ target_include_directories(Catch2
add_library(Catch2WithMain
${SOURCES_DIR}/internal/catch_main.cpp
)
-add_build_reproducibility_settings(Catch2WithMain)
+if (CATCH_ENABLE_REPRODUCIBLE_BUILD)
+ add_build_reproducibility_settings(Catch2WithMain)
+endif()
add_library(Catch2::Catch2WithMain ALIAS Catch2WithMain)
target_link_libraries(Catch2WithMain PUBLIC Catch2)
set_target_properties(Catch2WithMain