From ac0b9a6e450f698fd3d0aae5892cf2125975cbf4 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sun, 21 Oct 2018 20:58:19 +0200 Subject: [PATCH] Only apply c++14 to current target --- cmake-utils/utils.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()