From 8ce92d2c7288b6b3261caf1c016f8a779b6a8efc Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Mon, 24 Oct 2022 18:26:40 +0200 Subject: [PATCH] CatchMiscFunctions.cmake: Use PRIVATE for target_compile_options (#2553) With the changes to how `-ffile-prefix-map` is detected, Catch2 started propagating the flag to its dependents, which isn't the desired behaviour, the normalization should only apply to Catch2's impl. --- CMake/CatchMiscFunctions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/CatchMiscFunctions.cmake b/CMake/CatchMiscFunctions.cmake index be76d838..5a068d08 100644 --- a/CMake/CatchMiscFunctions.cmake +++ b/CMake/CatchMiscFunctions.cmake @@ -13,7 +13,7 @@ function(add_cxx_flag_if_supported_to_targets flagname targets) if (HAVE_FLAG_${flag_identifier}) foreach(target ${targets}) - target_compile_options(${target} PUBLIC ${flagname}) + target_compile_options(${target} PRIVATE ${flagname}) endforeach() endif() endfunction()