mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
PGI: Pass macOS-specific link flags directly to linker
The PGI compiler on macOS does not support some macOS-specific flags so pass them through `-Wl,` to the linker directly. Issue: #16457
This commit is contained in:
2
Modules/Platform/Darwin-PGI-C.cmake
Normal file
2
Modules/Platform/Darwin-PGI-C.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
include(Platform/Darwin-PGI)
|
||||
__darwin_compiler_pgi(C)
|
||||
2
Modules/Platform/Darwin-PGI-CXX.cmake
Normal file
2
Modules/Platform/Darwin-PGI-CXX.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
include(Platform/Darwin-PGI)
|
||||
__darwin_compiler_pgi(CXX)
|
||||
2
Modules/Platform/Darwin-PGI-Fortran.cmake
Normal file
2
Modules/Platform/Darwin-PGI-Fortran.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
include(Platform/Darwin-PGI)
|
||||
__darwin_compiler_pgi(Fortran)
|
||||
14
Modules/Platform/Darwin-PGI.cmake
Normal file
14
Modules/Platform/Darwin-PGI.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
# This module is shared by multiple languages; use include blocker.
|
||||
if(__DARWIN_COMPILER_PGI)
|
||||
return()
|
||||
endif()
|
||||
set(__DARWIN_COMPILER_PGI 1)
|
||||
|
||||
macro(__darwin_compiler_pgi lang)
|
||||
set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version,")
|
||||
set(CMAKE_${lang}_OSX_CURRENT_VERSION_FLAG "-Wl,-current_version,")
|
||||
set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-install_name")
|
||||
endmacro()
|
||||
Reference in New Issue
Block a user