summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2017-05-01 17:21:31 (GMT)
committerChuck Atkins <chuck.atkins@kitware.com>2017-05-02 13:49:23 (GMT)
commitd908987634ad1dd1295ac585ffe7c810bda69415 (patch)
treefb5105449faba4e5ef79ded09b2e8db3619892fa /Modules/Compiler
parent174c02e149ab4bcc9bc98d4e4042eb0b24e2f2ee (diff)
downloadCMake-d908987634ad1dd1295ac585ffe7c810bda69415.zip
CMake-d908987634ad1dd1295ac585ffe7c810bda69415.tar.gz
CMake-d908987634ad1dd1295ac585ffe7c810bda69415.tar.bz2
AppleClang: Use common compiler macros for language standard default
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/AppleClang-C.cmake12
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake13
2 files changed, 2 insertions, 23 deletions
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index f874e74..c18f541 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -12,17 +12,7 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
endif()
-if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
- 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.
- set(CMAKE_C_STANDARD_DEFAULT 99)
- endif()
-endif()
+__compiler_check_default_language_standard(C 4.0 99)
macro(cmake_record_c_compile_features)
set(_result 0)
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index ee900ae..904d965 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -27,18 +27,7 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.1)
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
endif()
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
- 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 4.0 98)
macro(cmake_record_cxx_compile_features)
set(_result 0)