summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2016-06-05 19:30:12 (GMT)
committerBrad King <brad.king@kitware.com>2016-06-06 12:58:20 (GMT)
commitfcfe121fd82fcb24c9f40f052cb20d403c92edb7 (patch)
treebecc42198ac497bcf72ece595b8858c148e7736d
parent9d81f1b3aaa82d12a3a87067572b3ff5e2b9c4d2 (diff)
downloadCMake-fcfe121fd82fcb24c9f40f052cb20d403c92edb7.zip
CMake-fcfe121fd82fcb24c9f40f052cb20d403c92edb7.tar.gz
CMake-fcfe121fd82fcb24c9f40f052cb20d403c92edb7.tar.bz2
Platform: add flag definitions for PathScale compiler on SunOS (#16135)
-rw-r--r--Modules/Platform/SunOS-PathScale-C.cmake2
-rw-r--r--Modules/Platform/SunOS-PathScale-CXX.cmake2
-rw-r--r--Modules/Platform/SunOS-PathScale-Fortran.cmake2
-rw-r--r--Modules/Platform/SunOS-PathScale.cmake31
4 files changed, 37 insertions, 0 deletions
diff --git a/Modules/Platform/SunOS-PathScale-C.cmake b/Modules/Platform/SunOS-PathScale-C.cmake
new file mode 100644
index 0000000..2f78da1
--- /dev/null
+++ b/Modules/Platform/SunOS-PathScale-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/SunOS-PathScale)
+__sunos_compiler_pathscale(C)
diff --git a/Modules/Platform/SunOS-PathScale-CXX.cmake b/Modules/Platform/SunOS-PathScale-CXX.cmake
new file mode 100644
index 0000000..bb79d86
--- /dev/null
+++ b/Modules/Platform/SunOS-PathScale-CXX.cmake
@@ -0,0 +1,2 @@
+include(Platform/SunOS-PathScale)
+__sunos_compiler_pathscale(CXX)
diff --git a/Modules/Platform/SunOS-PathScale-Fortran.cmake b/Modules/Platform/SunOS-PathScale-Fortran.cmake
new file mode 100644
index 0000000..3c202f7
--- /dev/null
+++ b/Modules/Platform/SunOS-PathScale-Fortran.cmake
@@ -0,0 +1,2 @@
+include(Platform/SunOS-PathScale)
+__sunos_compiler_pathscale(Fortran)
diff --git a/Modules/Platform/SunOS-PathScale.cmake b/Modules/Platform/SunOS-PathScale.cmake
new file mode 100644
index 0000000..1afe56a
--- /dev/null
+++ b/Modules/Platform/SunOS-PathScale.cmake
@@ -0,0 +1,31 @@
+
+#=============================================================================
+# Copyright 2016 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This module is shared by multiple languages; use include blocker.
+if(__SUNOS_COMPILER_PATHSCALE)
+ return()
+endif()
+set(__SUNOS_COMPILER_PATHSCALE 1)
+
+macro(__sunos_compiler_pathscale lang)
+ # Shared library compile and link flags.
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
+
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-R")
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
+ set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-h")
+endmacro()