Features: Use the correct dialect flag when recording features.

Avoid using -std=c++1y for compilers which support -std=c++14, for
example.
This commit is contained in:
Stephen Kelly 2014-11-11 23:06:03 +01:00
parent b18155b788
commit 82c283f914
4 changed files with 16 additions and 16 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)