mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 21:00:01 -05:00
NVHPC: Enable PIE support on linux
This commit is contained in:
@@ -3,13 +3,15 @@
|
||||
|
||||
|
||||
# This module is shared by multiple languages; use include blocker.
|
||||
if(__LINUX_COMPILER_NVIDIA)
|
||||
return()
|
||||
endif()
|
||||
set(__LINUX_COMPILER_NVIDIA 1)
|
||||
|
||||
include(Platform/Linux-PGI)
|
||||
include_guard()
|
||||
|
||||
macro(__linux_compiler_nvhpc lang)
|
||||
__linux_compiler_pgi(${lang})
|
||||
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
|
||||
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
|
||||
set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES)
|
||||
set(CMAKE_${lang}_LINK_OPTIONS_PIE "-fPIE")
|
||||
set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "")
|
||||
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "")
|
||||
endmacro()
|
||||
|
||||
Reference in New Issue
Block a user