From 82c283f914c23df9e11cdc50f764bfa054540f54 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 11 Nov 2014 23:06:03 +0100 Subject: Features: Use the correct dialect flag when recording features. Avoid using -std=c++1y for compilers which support -std=c++14, for example. --- Modules/Compiler/Clang-C.cmake | 8 ++++---- Modules/Compiler/Clang-CXX.cmake | 8 ++++---- Modules/Compiler/GNU-C.cmake | 8 ++++---- Modules/Compiler/GNU-CXX.cmake | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index 05d3c0b..92119ba 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -21,16 +21,16 @@ set(CMAKE_C_STANDARD_DEFAULT 90) macro(cmake_record_c_compile_features) macro(_get_clang_features std_version list) - record_compiler_features(C "-std=${std_version}" ${list}) + record_compiler_features(C "${std_version}" ${list}) endmacro() if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) - _get_clang_features(c11 CMAKE_C11_COMPILE_FEATURES) + _get_clang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) - _get_clang_features(c99 CMAKE_C99_COMPILE_FEATURES) + _get_clang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_clang_features(c90 CMAKE_C90_COMPILE_FEATURES) + _get_clang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) endif() else() set(_result 0) diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 5dd7b4a..780a072 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -35,16 +35,16 @@ set(CMAKE_CXX_STANDARD_DEFAULT 98) macro(cmake_record_cxx_compile_features) macro(_get_clang_features std_version list) - record_compiler_features(CXX "-std=${std_version}" ${list}) + record_compiler_features(CXX "${std_version}" ${list}) endmacro() if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) - _get_clang_features(c++1y CMAKE_CXX14_COMPILE_FEATURES) + _get_clang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) if (_result EQUAL 0) - _get_clang_features(c++11 CMAKE_CXX11_COMPILE_FEATURES) + _get_clang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_clang_features(c++98 CMAKE_CXX98_COMPILE_FEATURES) + _get_clang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) endif() else() set(_result 0) diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index d678b68..c4a2ed6 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -17,16 +17,16 @@ set(CMAKE_C_STANDARD_DEFAULT 90) macro(cmake_record_c_compile_features) macro(_get_gcc_features std_version list) - record_compiler_features(C "-std=${std_version}" ${list}) + record_compiler_features(C "${std_version}" ${list}) endmacro() if (UNIX AND NOT APPLE AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) - _get_gcc_features(c11 CMAKE_C11_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) - _get_gcc_features(c99 CMAKE_C99_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_gcc_features(c90 CMAKE_C90_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) endif() else() set(_result 0) diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 14dc76a..1050679 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -33,19 +33,19 @@ set(CMAKE_CXX_STANDARD_DEFAULT 98) macro(cmake_record_cxx_compile_features) macro(_get_gcc_features std_version list) - record_compiler_features(CXX "-std=${std_version}" ${list}) + record_compiler_features(CXX "${std_version}" ${list}) endmacro() set(_result 0) if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - _get_gcc_features(c++1y CMAKE_CXX14_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) if (_result EQUAL 0) - _get_gcc_features(c++11 CMAKE_CXX11_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() if (_result EQUAL 0) - _get_gcc_features(c++98 CMAKE_CXX98_COMPILE_FEATURES) + _get_gcc_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) endif() else() set(_result 0) -- cgit v0.12