summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-25 13:36:03 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-25 13:36:17 (GMT)
commit499e36d932910186e1c1db1cc0d18fe93e47ee55 (patch)
tree571f2e59561be7abd40307a03ff7d8fa0bac6e19 /Modules
parent5c724c4ca83059b13e6fd64dad9ee88f59162166 (diff)
parentb886b46ccb37a273e63f472a767b58aea50af724 (diff)
downloadCMake-499e36d932910186e1c1db1cc0d18fe93e47ee55.zip
CMake-499e36d932910186e1c1db1cc0d18fe93e47ee55.tar.gz
CMake-499e36d932910186e1c1db1cc0d18fe93e47ee55.tar.bz2
Merge topic 'fix-cray-pic'
b886b46c Cray: Add common PIC flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1692
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/Cray-C.cmake3
-rw-r--r--Modules/Compiler/Cray-CXX.cmake3
-rw-r--r--Modules/Compiler/Cray-Fortran.cmake7
-rw-r--r--Modules/Compiler/Cray.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv.cmake1
5 files changed, 15 insertions, 6 deletions
diff --git a/Modules/Compiler/Cray-C.cmake b/Modules/Compiler/Cray-C.cmake
index 87ce20f..d34154c 100644
--- a/Modules/Compiler/Cray-C.cmake
+++ b/Modules/Compiler/Cray-C.cmake
@@ -2,8 +2,7 @@
# file Copyright.txt or https://cmake.org/licensing for details.
include(Compiler/Cray)
-
-set(CMAKE_C_VERBOSE_FLAG "-v")
+__compiler_cray(C)
string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
diff --git a/Modules/Compiler/Cray-CXX.cmake b/Modules/Compiler/Cray-CXX.cmake
index 8506c094..a1899e6 100644
--- a/Modules/Compiler/Cray-CXX.cmake
+++ b/Modules/Compiler/Cray-CXX.cmake
@@ -2,8 +2,7 @@
# file Copyright.txt or https://cmake.org/licensing for details.
include(Compiler/Cray)
-
-set(CMAKE_CXX_VERBOSE_FLAG "-v")
+__compiler_cray(C)
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
diff --git a/Modules/Compiler/Cray-Fortran.cmake b/Modules/Compiler/Cray-Fortran.cmake
index 5d81bb0..dbf28e3 100644
--- a/Modules/Compiler/Cray-Fortran.cmake
+++ b/Modules/Compiler/Cray-Fortran.cmake
@@ -1,4 +1,9 @@
-set(CMAKE_Fortran_VERBOSE_FLAG "-v")
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include(Compiler/Cray)
+__compiler_cray(Fortran)
+
set(CMAKE_Fortran_MODOUT_FLAG -em)
set(CMAKE_Fortran_MODDIR_FLAG -J)
set(CMAKE_Fortran_MODDIR_DEFAULT .)
diff --git a/Modules/Compiler/Cray.cmake b/Modules/Compiler/Cray.cmake
index 8fe8eeb..c214afc 100644
--- a/Modules/Compiler/Cray.cmake
+++ b/Modules/Compiler/Cray.cmake
@@ -8,3 +8,10 @@ endif()
set(__COMPILER_CRAY 1)
include(Compiler/CMakeCommonCompilerMacros)
+
+macro(__compiler_cray lang)
+ set(CMAKE_${lang}_VERBOSE_FLAG "-v")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -h PIC)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIE -h PIC)
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-h PIC")
+endmacro()
diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake
index 3feea1c..05e3fc7 100644
--- a/Modules/Compiler/CrayPrgEnv.cmake
+++ b/Modules/Compiler/CrayPrgEnv.cmake
@@ -62,7 +62,6 @@ macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd)
# Flags for the Cray wrappers
set(CMAKE_STATIC_LIBRARY_LINK_${lang}_FLAGS "-static")
- set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-dynamic")