summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/GNU-C.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler/GNU-C.cmake')
-rw-r--r--Modules/Compiler/GNU-C.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index 031ab73..5c68b1e 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -22,12 +22,14 @@ elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
endif()
-if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
- set(CMAKE_C_STANDARD_DEFAULT 11)
-elseif(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
- set(CMAKE_C_STANDARD_DEFAULT 90)
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+ 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)
macro(_get_gcc_features std_version list)
record_compiler_features(C "${std_version}" ${list})