GNU-C.cmake 1.04 KB
Newer Older
1 2
include(Compiler/GNU)
__compiler_gnu(C)
3

4
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
5 6
  set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
7
elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
8 9 10
  set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
endif()
11

12
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
13
  set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
14 15
  set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
  set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
16
  set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
17
endif()
18

19
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
20 21
  set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
  set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
22
  set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
23
elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
24 25
  set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x")
  set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
26 27
endif()

28
__compiler_check_default_language_standard(C 3.4 90 5.0 11)