PGI.cmake 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # This module is shared by multiple languages; use include blocker.
  4. if(__COMPILER_PGI)
  5. return()
  6. endif()
  7. set(__COMPILER_PGI 1)
  8. include(Compiler/CMakeCommonCompilerMacros)
  9. macro(__compiler_pgi lang)
  10. # Feature flags.
  11. set(CMAKE_${lang}_VERBOSE_FLAG "-v")
  12. # Initial configuration flags.
  13. string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
  14. string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -O0")
  15. string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O2 -s")
  16. string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -fast -O3")
  17. string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -gopt")
  18. if(CMAKE_HOST_WIN32)
  19. string(APPEND CMAKE_${lang}_FLAGS_INIT " -Bdynamic")
  20. endif()
  21. set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
  22. set(CMAKE_${lang}_LINKER_WRAPPER_FLAG ",")
  23. set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
  24. if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ppc64le AND (NOT CMAKE_HOST_WIN32 OR CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 16.3))
  25. set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
  26. set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-Mipa=fast,inline")
  27. else()
  28. set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)
  29. endif()
  30. # Preprocessing and assembly rules.
  31. set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
  32. set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
  33. endmacro()