SunPro-CXX.cmake 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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_CXX_VERBOSE_FLAG "-v")
  5. set(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC)
  6. set(CMAKE_CXX_COMPILE_OPTIONS_PIE "")
  7. set(_CMAKE_CXX_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
  8. set(CMAKE_CXX_LINK_OPTIONS_PIE "")
  9. set(CMAKE_CXX_LINK_OPTIONS_NO_PIE "")
  10. set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
  11. set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G")
  12. set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
  13. set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":")
  14. set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-h")
  15. string(APPEND CMAKE_CXX_FLAGS_INIT " ")
  16. string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -g")
  17. string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
  18. string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
  19. string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
  20. set(CMAKE_DEPFILE_FLAGS_CXX "-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_CXX_FLAGS "-Bstatic")
  27. set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
  28. endforeach()
  29. set(CMAKE_CXX_LINKER_WRAPPER_FLAG "-Qoption" "ld" " ")
  30. set(CMAKE_CXX_LINKER_WRAPPER_FLAG_SEP ",")
  31. set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
  32. set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
  33. # Create archives with "CC -xar" in case user adds "-instances=extern"
  34. # so that template instantiations are available to archive members.
  35. set(CMAKE_CXX_CREATE_STATIC_LIBRARY
  36. "<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
  37. "<CMAKE_RANLIB> <TARGET> ")
  38. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
  39. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++03")
  40. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=c++03")
  41. set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  42. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
  43. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
  44. set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION 1)
  45. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
  46. set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
  47. set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14")
  48. endif()
  49. else()
  50. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-library=stlport4")
  51. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-library=stlport4")
  52. set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION 1)
  53. endif()
  54. __compiler_check_default_language_standard(CXX 1 98)