diff --git a/CMake/CatchMiscFunctions.cmake b/CMake/CatchMiscFunctions.cmake index be76d8380..5a068d088 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()