diff options
Diffstat (limited to 'Modules/Compiler/Clang-C.cmake')
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index a2e81c1..d8b7743 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -23,6 +23,13 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) 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() |