summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-03-02 16:17:29 (GMT)
committerBrad King <brad.king@kitware.com>2011-03-02 16:20:50 (GMT)
commit89ea7a3d3c9487eb33caaedf1b636e0af092dcc2 (patch)
treecb47bc41e95adc3735d805771b8a4c511840a78b /Modules
parentf72cc88c659d586cc65ac47e7807054345ccad89 (diff)
downloadCMake-89ea7a3d3c9487eb33caaedf1b636e0af092dcc2.zip
CMake-89ea7a3d3c9487eb33caaedf1b636e0af092dcc2.tar.gz
CMake-89ea7a3d3c9487eb33caaedf1b636e0af092dcc2.tar.bz2
Factor AIX and XL compiler flags into common module
Factor duplicate flag information from Platform/AIX-XL-*.cmake into Platform/AIX-XL.cmake and load it from the original files.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/AIX-XL-C.cmake6
-rw-r--r--Modules/Platform/AIX-XL-CXX.cmake6
-rw-r--r--Modules/Platform/AIX-XL-Fortran.cmake6
-rw-r--r--Modules/Platform/AIX-XL.cmake26
4 files changed, 32 insertions, 12 deletions
diff --git a/Modules/Platform/AIX-XL-C.cmake b/Modules/Platform/AIX-XL-C.cmake
index 2de30d5..5e437fa 100644
--- a/Modules/Platform/AIX-XL-C.cmake
+++ b/Modules/Platform/AIX-XL-C.cmake
@@ -1,4 +1,2 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ")
-SET(CMAKE_SHARED_MODULE_C_FLAGS " ")
+include(Platform/AIX-XL)
+__aix_compiler_xl(C)
diff --git a/Modules/Platform/AIX-XL-CXX.cmake b/Modules/Platform/AIX-XL-CXX.cmake
index 648cb31..ef38a5f 100644
--- a/Modules/Platform/AIX-XL-CXX.cmake
+++ b/Modules/Platform/AIX-XL-CXX.cmake
@@ -1,4 +1,2 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ")
-SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ")
+include(Platform/AIX-XL)
+__aix_compiler_xl(CXX)
diff --git a/Modules/Platform/AIX-XL-Fortran.cmake b/Modules/Platform/AIX-XL-Fortran.cmake
index 8292e78..6d4f655 100644
--- a/Modules/Platform/AIX-XL-Fortran.cmake
+++ b/Modules/Platform/AIX-XL-Fortran.cmake
@@ -1,4 +1,2 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS " ")
-SET(CMAKE_SHARED_MODULE_Fortran_FLAGS " ")
+include(Platform/AIX-XL)
+__aix_compiler_xl(Fortran)
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake
new file mode 100644
index 0000000..c07f28d
--- /dev/null
+++ b/Modules/Platform/AIX-XL.cmake
@@ -0,0 +1,26 @@
+
+#=============================================================================
+# Copyright 2002-2011 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(__AIX_COMPILER_XL)
+ return()
+endif()
+set(__AIX_COMPILER_XL 1)
+
+macro(__aix_compiler_xl lang)
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ")
+ set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ")
+endmacro()