summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/AppleClang-C.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-09-15 17:42:26 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-18 14:00:21 (GMT)
commit7235334a2f1b9a627cc1cdbc701ae0768b6e32c3 (patch)
tree36675c9df0477e6ecdb027979cfce0dbbdab2d15 /Modules/Compiler/AppleClang-C.cmake
parentcda189356e7e0a897377c3d7ed02ea3a3ad1de5a (diff)
downloadCMake-7235334a2f1b9a627cc1cdbc701ae0768b6e32c3.zip
CMake-7235334a2f1b9a627cc1cdbc701ae0768b6e32c3.tar.gz
CMake-7235334a2f1b9a627cc1cdbc701ae0768b6e32c3.tar.bz2
Project: Determine default language dialect for the compiler.
Use the __cplusplus and __STDC_VERSION__ macros to automatically determine the default dialect for the compiler while determining its id and version.
Diffstat (limited to 'Modules/Compiler/AppleClang-C.cmake')
-rw-r--r--Modules/Compiler/AppleClang-C.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 10454f6..1db7d9e 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -13,7 +13,10 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
- set(CMAKE_C_STANDARD_DEFAULT 99)
+ 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})
endif()
macro(cmake_record_c_compile_features)