GNU-C.cmake 1.0 KB

12345678910111213141516171819202122232425262728
  1. include(Compiler/GNU)
  2. __compiler_gnu(C)
  3. if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
  4. set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
  5. set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
  6. elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
  7. set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
  8. set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
  9. endif()
  10. if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
  11. set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
  12. set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
  13. set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
  14. set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
  15. endif()
  16. if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
  17. set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
  18. set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
  19. set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
  20. elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
  21. set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x")
  22. set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
  23. endif()
  24. __compiler_check_default_language_standard(C 3.4 90 5.0 11)