diff options
Diffstat (limited to 'Modules/Compiler/Clang-C.cmake')
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index 548d0a5..ef3a46a 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -17,10 +17,11 @@ 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.6) - set(CMAKE_C_STANDARD_DEFAULT 11) -elseif(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) - set(CMAKE_C_STANDARD_DEFAULT 99) +if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.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) |