From c10ce38abcfeee0d5a9b6c074247698103e0cb5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Fri, 19 Nov 2021 16:58:05 +0100 Subject: [PATCH] #1602: CMake: mark added compilation flags as private --- cmake-modules/SetCXXCompilerFlags.cmake | 2 +- cmake/turn_on_warnings.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake-modules/SetCXXCompilerFlags.cmake b/cmake-modules/SetCXXCompilerFlags.cmake index 3c69819d69..af57b937c9 100644 --- a/cmake-modules/SetCXXCompilerFlags.cmake +++ b/cmake-modules/SetCXXCompilerFlags.cmake @@ -39,6 +39,6 @@ if (vt_ubsan_enabled) endif() message(DEBUG "Target ${vt_target} compile options: ${TARGET_CXX_FLAGS}") -target_compile_options(${vt_target} PUBLIC ${TARGET_CXX_FLAGS}) +target_compile_options(${vt_target} PRIVATE ${TARGET_CXX_FLAGS}) endmacro() diff --git a/cmake/turn_on_warnings.cmake b/cmake/turn_on_warnings.cmake index c44d9b1047..c5b1de40e9 100644 --- a/cmake/turn_on_warnings.cmake +++ b/cmake/turn_on_warnings.cmake @@ -3,7 +3,7 @@ include(CheckCXXCompilerFlag) function(enable_cxx_compiler_flag_if_supported flag) check_cxx_compiler_flag("${flag}" flag_supported) if(flag_supported) - target_compile_options(${vt_target} PUBLIC ${flag}) + target_compile_options(${vt_target} PRIVATE ${flag}) endif() unset(flag_supported CACHE) endfunction() @@ -22,4 +22,4 @@ function(turn_on_warnings vt_target) enable_cxx_compiler_flag_if_supported("-Werror") endif() endif() -endfunction() \ No newline at end of file +endfunction()