NVHPC: Enable PIE support on linux

This commit is contained in:
Robert Maynard
2021-02-25 09:58:47 -08:00
parent 5d0685aa3e
commit 52dc49deb9
+9 -7
View File
@@ -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()