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:
parent
b18155b788
commit
82c283f914
|
@ -21,16 +21,16 @@ set(CMAKE_C_STANDARD_DEFAULT 90)
|
||||||
|
|
||||||
macro(cmake_record_c_compile_features)
|
macro(cmake_record_c_compile_features)
|
||||||
macro(_get_clang_features std_version list)
|
macro(_get_clang_features std_version list)
|
||||||
record_compiler_features(C "-std=${std_version}" ${list})
|
record_compiler_features(C "${std_version}" ${list})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
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)
|
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()
|
endif()
|
||||||
if (_result EQUAL 0)
|
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()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(_result 0)
|
set(_result 0)
|
||||||
|
|
|
@ -35,16 +35,16 @@ set(CMAKE_CXX_STANDARD_DEFAULT 98)
|
||||||
|
|
||||||
macro(cmake_record_cxx_compile_features)
|
macro(cmake_record_cxx_compile_features)
|
||||||
macro(_get_clang_features std_version list)
|
macro(_get_clang_features std_version list)
|
||||||
record_compiler_features(CXX "-std=${std_version}" ${list})
|
record_compiler_features(CXX "${std_version}" ${list})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
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)
|
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()
|
endif()
|
||||||
if (_result EQUAL 0)
|
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()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(_result 0)
|
set(_result 0)
|
||||||
|
|
|
@ -17,16 +17,16 @@ set(CMAKE_C_STANDARD_DEFAULT 90)
|
||||||
|
|
||||||
macro(cmake_record_c_compile_features)
|
macro(cmake_record_c_compile_features)
|
||||||
macro(_get_gcc_features std_version list)
|
macro(_get_gcc_features std_version list)
|
||||||
record_compiler_features(C "-std=${std_version}" ${list})
|
record_compiler_features(C "${std_version}" ${list})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
|
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)
|
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()
|
endif()
|
||||||
if (_result EQUAL 0)
|
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()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(_result 0)
|
set(_result 0)
|
||||||
|
|
|
@ -33,19 +33,19 @@ set(CMAKE_CXX_STANDARD_DEFAULT 98)
|
||||||
|
|
||||||
macro(cmake_record_cxx_compile_features)
|
macro(cmake_record_cxx_compile_features)
|
||||||
macro(_get_gcc_features std_version list)
|
macro(_get_gcc_features std_version list)
|
||||||
record_compiler_features(CXX "-std=${std_version}" ${list})
|
record_compiler_features(CXX "${std_version}" ${list})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
set(_result 0)
|
set(_result 0)
|
||||||
if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
|
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()
|
endif()
|
||||||
if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
||||||
if (_result EQUAL 0)
|
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()
|
endif()
|
||||||
if (_result EQUAL 0)
|
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()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(_result 0)
|
set(_result 0)
|
||||||
|
|
Loading…
Reference in New Issue