mirror of
https://github.com/reactos/CMake.git
synced 2024-11-24 12:09:48 +00:00
Clang: Use common compiler macros for language standard default
This commit is contained in:
parent
0198502ff4
commit
08fa2ba8d0
@ -17,21 +17,7 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
if (NOT CMAKE_C_COMPILER_FORCED)
|
||||
if (NOT CMAKE_C_STANDARD_COMPUTED_DEFAULT)
|
||||
message(FATAL_ERROR "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER}) version ${CMAKE_C_COMPILER_VERSION}")
|
||||
endif()
|
||||
set(CMAKE_C_STANDARD_DEFAULT ${CMAKE_C_STANDARD_COMPUTED_DEFAULT})
|
||||
elseif(NOT DEFINED CMAKE_C_STANDARD_DEFAULT)
|
||||
# Compiler id was forced so just guess the default standard level.
|
||||
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6)
|
||||
set(CMAKE_C_STANDARD_DEFAULT 11)
|
||||
else()
|
||||
set(CMAKE_C_STANDARD_DEFAULT 99)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
__compiler_check_default_language_standard(C 3.4 99 3.6 11)
|
||||
|
||||
macro(cmake_record_c_compile_features)
|
||||
set(_result 0)
|
||||
|
@ -36,17 +36,7 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
|
||||
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
|
||||
if (NOT CMAKE_CXX_COMPILER_FORCED)
|
||||
if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
|
||||
message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
|
||||
elseif(NOT DEFINED CMAKE_CXX_STANDARD_DEFAULT)
|
||||
# Compiler id was forced so just guess the default standard level.
|
||||
set(CMAKE_CXX_STANDARD_DEFAULT 98)
|
||||
endif()
|
||||
endif()
|
||||
__compiler_check_default_language_standard(CXX 3.1 98)
|
||||
|
||||
macro(cmake_record_cxx_compile_features)
|
||||
set(_result 0)
|
||||
|
@ -8,6 +8,8 @@ if(__COMPILER_CLANG)
|
||||
endif()
|
||||
set(__COMPILER_CLANG 1)
|
||||
|
||||
include(Compiler/CMakeCommonCompilerMacros)
|
||||
|
||||
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
|
||||
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
|
||||
macro(__compiler_clang lang)
|
||||
|
Loading…
Reference in New Issue
Block a user