XL-CXX.cmake 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. include(Compiler/XL)
  2. __compiler_xl(CXX)
  3. string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
  4. string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
  5. # -qthreaded = Ensures that all optimizations will be thread-safe
  6. string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded")
  7. if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
  8. if(CMAKE_SYSTEM MATCHES "Linux")
  9. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
  10. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
  11. else()
  12. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-qlanglvl=strict98")
  13. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-qlanglvl=extended")
  14. endif()
  15. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-qlanglvl=extended0x")
  16. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-qlanglvl=extended0x")
  17. set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  18. set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
  19. if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.1.0)
  20. set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-qlanglvl=extended1y")
  21. set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-qlanglvl=extended1y")
  22. set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
  23. endif()
  24. endif ()
  25. __compiler_check_default_language_standard(CXX 10.1 98)
  26. set(CMAKE_CXX_COMPILE_OBJECT
  27. "<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")