From fb31229e9928534162c2f14d23c45bb939eaffd9 Mon Sep 17 00:00:00 2001
From: Christian Pfeiffer <cpfeiffer@live.de>
Date: Fri, 5 May 2017 17:30:11 +0200
Subject: Linux-PGI: Prevent -rdynamic ending up in flags

Ensure that PGI on Linux keeps its
CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS empty, especially of -rdynamic.
In CMakeFortranInformation a lot of flags will be copied from their C
equivalents if they're not defined. By using a combination of GCC and
PGFortran, this will lead to -rdynamic ending up in the PGI flags and
none of the PGI compilers understand that flag, crashing with a fatal
error.
---
 Modules/Platform/Linux-PGI.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Modules/Platform/Linux-PGI.cmake b/Modules/Platform/Linux-PGI.cmake
index a407e43..db032c2 100644
--- a/Modules/Platform/Linux-PGI.cmake
+++ b/Modules/Platform/Linux-PGI.cmake
@@ -14,4 +14,5 @@ macro(__linux_compiler_pgi lang)
   set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "")
   set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
   set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
+  set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS " ")
 endmacro()
-- 
cgit v0.12