Windows-PGI.cmake 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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(__WINDOWS_COMPILER_PGI)
  5. return()
  6. endif()
  7. set(__WINDOWS_COMPILER_PGI 1)
  8. # PGI on Windows doesn't support parallel compile processes
  9. if(NOT DEFINED CMAKE_JOB_POOL_LINK OR NOT DEFINED CMAKE_JOB_POOL_COMPILE)
  10. set(CMAKE_JOB_POOL_LINK PGITaskPool)
  11. set(CMAKE_JOB_POOL_COMPILE PGITaskPool)
  12. get_property(_pgijp GLOBAL PROPERTY JOB_POOLS)
  13. if(NOT _pgijp MATCHES "PGITaskPool=")
  14. set_property(GLOBAL APPEND PROPERTY JOB_POOLS PGITaskPool=1)
  15. endif()
  16. unset(_pgijp)
  17. endif()
  18. set(CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS 1)
  19. set(CMAKE_LINK_DEF_FILE_FLAG "-def:")
  20. # The link flags for PGI are the raw filename to add a file
  21. # and the UNIX -L syntax to link directories.
  22. set(CMAKE_LINK_LIBRARY_FLAG "")
  23. set(CMAKE_LINK_STARTFILE "pgimain[mx][xpt]+[.]obj")
  24. # Default to Debug builds, mirroring Windows-MSVC behavior
  25. set(CMAKE_BUILD_TYPE_INIT Debug)
  26. if(CMAKE_VERBOSE_MAKEFILE)
  27. set(CMAKE_CL_NOLOGO)
  28. else()
  29. set(CMAKE_CL_NOLOGO "/nologo")
  30. endif()
  31. macro(__windows_compiler_pgi lang)
  32. # Shared library compile and link rules.
  33. set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
  34. set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} -Mmakedll -implib:<TARGET_IMPLIB> -Xlinker -pdb:<TARGET_PDB> -Xlinker -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
  35. set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
  36. set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} -implib:<TARGET_IMPLIB> -Xlinker -pdb:<TARGET_PDB> -Xlinker -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
  37. if("${lang}" MATCHES "C|CXX")
  38. set(CMAKE_${lang}_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
  39. endif()
  40. endmacro()