summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/GNU-ASM.cmake6
-rw-r--r--Modules/Compiler/HP-ASM.cmake3
-rw-r--r--Modules/Compiler/HP-C.cmake3
-rw-r--r--Modules/Compiler/HP-CXX.cmake3
-rw-r--r--Modules/Compiler/Intel-ASM.cmake13
-rw-r--r--Modules/Compiler/SunPro-ASM.cmake24
-rw-r--r--Modules/Compiler/XL-ASM.cmake13
-rw-r--r--Modules/Compiler/XL-C.cmake13
-rw-r--r--Modules/Compiler/XL-CXX.cmake15
-rw-r--r--Modules/Compiler/XL-Fortran.cmake14
-rw-r--r--Modules/Compiler/XL.cmake48
11 files changed, 133 insertions, 22 deletions
diff --git a/Modules/Compiler/GNU-ASM.cmake b/Modules/Compiler/GNU-ASM.cmake
new file mode 100644
index 0000000..e07401d
--- /dev/null
+++ b/Modules/Compiler/GNU-ASM.cmake
@@ -0,0 +1,6 @@
+# This file is loaded when gcc/g++ is used for assembler files (the "ASM" cmake language)
+include(Compiler/GNU)
+
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm)
+
+__compiler_gnu(ASM)
diff --git a/Modules/Compiler/HP-ASM.cmake b/Modules/Compiler/HP-ASM.cmake
new file mode 100644
index 0000000..8aa7bdb
--- /dev/null
+++ b/Modules/Compiler/HP-ASM.cmake
@@ -0,0 +1,3 @@
+SET(CMAKE_ASM_VERBOSE_FLAG "-v")
+
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
diff --git a/Modules/Compiler/HP-C.cmake b/Modules/Compiler/HP-C.cmake
index abf384a..dc7fbb2 100644
--- a/Modules/Compiler/HP-C.cmake
+++ b/Modules/Compiler/HP-C.cmake
@@ -1 +1,4 @@
SET(CMAKE_C_VERBOSE_FLAG "-v")
+
+SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/HP-CXX.cmake b/Modules/Compiler/HP-CXX.cmake
index f3c6b5f..82c1a86 100644
--- a/Modules/Compiler/HP-CXX.cmake
+++ b/Modules/Compiler/HP-CXX.cmake
@@ -1 +1,4 @@
SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+
+SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/Intel-ASM.cmake b/Modules/Compiler/Intel-ASM.cmake
new file mode 100644
index 0000000..59b50a1
--- /dev/null
+++ b/Modules/Compiler/Intel-ASM.cmake
@@ -0,0 +1,13 @@
+SET(CMAKE_ASM_VERBOSE_FLAG "-v")
+
+SET(CMAKE_ASM_FLAGS_INIT "")
+SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+
+IF(UNIX)
+ SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
+ELSE(UNIX)
+ SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
+ENDIF(UNIX)
diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake
new file mode 100644
index 0000000..dfc5702
--- /dev/null
+++ b/Modules/Compiler/SunPro-ASM.cmake
@@ -0,0 +1,24 @@
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
+
+SET(CMAKE_ASM_VERBOSE_FLAG "-#")
+
+SET(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-KPIC")
+SET(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-G")
+SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG "-R")
+SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG_SEP ":")
+SET(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG "-h")
+
+SET(CMAKE_ASM_FLAGS_INIT "")
+SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+
+# Initialize ASM link type selection flags. These flags are used when
+# building a shared library, shared module, or executable that links
+# to other libraries to select whether to use the static or shared
+# versions of the libraries.
+FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
+ENDFOREACH(type)
diff --git a/Modules/Compiler/XL-ASM.cmake b/Modules/Compiler/XL-ASM.cmake
new file mode 100644
index 0000000..e5d4ffa
--- /dev/null
+++ b/Modules/Compiler/XL-ASM.cmake
@@ -0,0 +1,13 @@
+SET(CMAKE_ASM_VERBOSE_FLAG "-V")
+
+# -qthreaded = Ensures that all optimizations will be thread-safe
+# -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
+# -qhalt=e = Halt on error messages (rather than just severe errors)
+SET(CMAKE_ASM_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e -qsourcetype=assembler")
+
+SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-O -DNDEBUG")
+SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
+SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g")
+
+SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake
index 8f66557..ae869e3 100644
--- a/Modules/Compiler/XL-C.cmake
+++ b/Modules/Compiler/XL-C.cmake
@@ -1,14 +1,9 @@
-SET(CMAKE_C_VERBOSE_FLAG "-V")
+include(Compiler/XL)
+__compiler_xl(C)
+set(CMAKE_C_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT} -DNDEBUG")
+set(CMAKE_C_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
# -qthreaded = Ensures that all optimizations will be thread-safe
# -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
# -qhalt=e = Halt on error messages (rather than just severe errors)
SET(CMAKE_C_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e")
-
-SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_C_FLAGS_RELEASE_INIT "-O -DNDEBUG")
-SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
-
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake
index 961cfee..29c4b5e 100644
--- a/Modules/Compiler/XL-CXX.cmake
+++ b/Modules/Compiler/XL-CXX.cmake
@@ -1,12 +1,11 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-V")
+include(Compiler/XL)
+__compiler_xl(CXX)
+set(CMAKE_CXX_FLAGS_RELEASE_INIT "${CMAKE_CXX_FLAGS_RELEASE_INIT} -DNDEBUG")
+set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g")
+# -qthreaded = Ensures that all optimizations will be thread-safe
+# -qhalt=e = Halt on error messages (rather than just severe errors)
+SET(CMAKE_CXX_FLAGS_INIT "-qthreaded -qhalt=e")
SET(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> -+ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index cf9b2b6..e6f2317 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -1,8 +1,12 @@
-SET(CMAKE_Fortran_VERBOSE_FLAG "-V")
+include(Compiler/XL)
+__compiler_xl(Fortran)
SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O")
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-O")
-SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g")
+# -qthreaded = Ensures that all optimizations will be thread-safe
+# -qhalt=e = Halt on error messages (rather than just severe errors)
+SET(CMAKE_Fortran_FLAGS_INIT "-qthreaded -qhalt=e")
+
+# We require updates to CMake C++ code to support preprocessing rules for Fortran.
+SET(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
+SET(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake
new file mode 100644
index 0000000..d07890f
--- /dev/null
+++ b/Modules/Compiler/XL.cmake
@@ -0,0 +1,48 @@
+
+#=============================================================================
+# 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(__COMPILER_XL)
+ return()
+endif()
+set(__COMPILER_XL 1)
+
+# Find the CreateExportList program that comes with this toolchain.
+find_program(CMAKE_XL_CreateExportList
+ NAMES CreateExportList
+ DOC "IBM XL CreateExportList tool"
+ )
+
+macro(__compiler_xl lang)
+ # Feature flags.
+ set(CMAKE_${lang}_VERBOSE_FLAG "-V")
+
+ set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
+ set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O")
+ set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-O")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-g")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+
+ # The compiler front-end passes all object files, archive files, and shared
+ # library files named on the command line to CreateExportList to create a
+ # list of all symbols to be exported from the shared library. This causes
+ # all archive members to be copied into the shared library whether they are
+ # needed or not. Instead we run the tool ourselves to pass only the object
+ # files so that we export only the symbols actually provided by the sources.
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+ "${CMAKE_XL_CreateExportList} <OBJECT_DIR>/objects.exp <OBJECTS>"
+ "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
+ )
+endmacro()