diff --git a/cmake-utils/utils.cmake b/cmake-utils/utils.cmake index c697332f..85f31802 100644 --- a/cmake-utils/utils.cmake +++ b/cmake-utils/utils.cmake @@ -12,11 +12,11 @@ function(target_activate_cpp14 TARGET) else("${CMAKE_VERSION}" VERSION_GREATER "3.1") check_cxx_compiler_flag("-std=c++14" COMPILER_HAS_CPP14_SUPPORT) if (COMPILER_HAS_CPP14_SUPPORT) - target_compile_options(${TARGET} PUBLIC -std=c++14) + target_compile_options(${TARGET} PRIVATE -std=c++14) else(COMPILER_HAS_CPP14_SUPPORT) check_cxx_compiler_flag("-std=c++1y" COMPILER_HAS_CPP14_PARTIAL_SUPPORT) if (COMPILER_HAS_CPP14_PARTIAL_SUPPORT) - target_compile_options(${TARGET} PUBLIC -std=c++1y) + target_compile_options(${TARGET} PRIVATE -std=c++1y) else() message(FATAL_ERROR "Compiler doesn't support C++14") endif()