SunPro-C.cmake 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. include(Compiler/SunPro)
  4. set(CMAKE_C_VERBOSE_FLAG "-#")
  5. set(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC)
  6. set(CMAKE_C_COMPILE_OPTIONS_PIE "")
  7. set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
  8. set(CMAKE_C_LINK_OPTIONS_PIE "")
  9. set(CMAKE_C_LINK_OPTIONS_NO_PIE "")
  10. set(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
  11. set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
  12. set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
  13. set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
  14. set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h")
  15. string(APPEND CMAKE_C_FLAGS_INIT " ")
  16. string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -g")
  17. string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
  18. string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
  19. string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
  20. set(CMAKE_DEPFILE_FLAGS_C "-xMD -xMF <DEPFILE>")
  21. # Initialize C link type selection flags. These flags are used when
  22. # building a shared library, shared module, or executable that links
  23. # to other libraries to select whether to use the static or shared
  24. # versions of the libraries.
  25. foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
  26. set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
  27. set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
  28. endforeach()
  29. set(CMAKE_C_LINKER_WRAPPER_FLAG "-Qoption" "ld" " ")
  30. set(CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")
  31. if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.13)
  32. set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
  33. set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=c89")
  34. set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
  35. set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
  36. set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=c99")
  37. set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
  38. set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
  39. set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=c11")
  40. set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
  41. elseif (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.11)
  42. set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
  43. set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
  44. set(CMAKE_C99_STANDARD_COMPILE_OPTION "-xc99")
  45. set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-xc99")
  46. endif()
  47. __compiler_check_default_language_standard(C 5.11 90 5.14 11)
  48. set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
  49. set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")