summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/ARMCC.cmake10
-rw-r--r--Modules/Compiler/Absoft-Fortran.cmake10
-rw-r--r--Modules/Compiler/AppleClang-DetermineCompiler.cmake2
-rw-r--r--Modules/Compiler/Bruce-C.cmake10
-rw-r--r--Modules/Compiler/G95-Fortran.cmake10
-rw-r--r--Modules/Compiler/GHS-C.cmake10
-rw-r--r--Modules/Compiler/GHS-CXX.cmake10
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake4
-rw-r--r--Modules/Compiler/GNU.cmake12
-rw-r--r--Modules/Compiler/IAR.cmake5
-rw-r--r--Modules/Compiler/Intel-ASM.cmake11
-rw-r--r--Modules/Compiler/Intel-C.cmake11
-rw-r--r--Modules/Compiler/Intel-CXX.cmake11
-rw-r--r--Modules/Compiler/Intel-Fortran.cmake9
-rw-r--r--Modules/Compiler/Intel.cmake36
-rw-r--r--Modules/Compiler/NAG-Fortran.cmake1
-rw-r--r--Modules/Compiler/PGI-C.cmake4
-rw-r--r--Modules/Compiler/PGI-CXX.cmake4
-rw-r--r--Modules/Compiler/PGI-Fortran.cmake4
-rw-r--r--Modules/Compiler/PGI.cmake10
-rw-r--r--Modules/Compiler/PathScale-C.cmake4
-rw-r--r--Modules/Compiler/PathScale-CXX.cmake4
-rw-r--r--Modules/Compiler/PathScale.cmake10
-rw-r--r--Modules/Compiler/SunPro-ASM.cmake10
-rw-r--r--Modules/Compiler/SunPro-C.cmake10
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake10
-rw-r--r--Modules/Compiler/SunPro-Fortran.cmake10
-rw-r--r--Modules/Compiler/TinyCC-C.cmake10
-rw-r--r--Modules/Compiler/XL-ASM.cmake10
-rw-r--r--Modules/Compiler/XL-C.cmake6
-rw-r--r--Modules/Compiler/XL-CXX.cmake6
-rw-r--r--Modules/Compiler/XL-Fortran.cmake2
-rw-r--r--Modules/Compiler/XL.cmake8
33 files changed, 158 insertions, 126 deletions
diff --git a/Modules/Compiler/ARMCC.cmake b/Modules/Compiler/ARMCC.cmake
index 3cf628c..2ec75c3 100644
--- a/Modules/Compiler/ARMCC.cmake
+++ b/Modules/Compiler/ARMCC.cmake
@@ -20,11 +20,11 @@ set(CMAKE_AR "${CMAKE_ARMCC_AR}" CACHE FILEPATH "The ARMCC archiver" FORCE)
mark_as_advanced(CMAKE_ARMCC_AR)
macro(__compiler_armcc lang)
- set(CMAKE_${lang}_FLAGS_INIT "")
- set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
- set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Ospace -DNDEBUG")
- set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-Otime -DNDEBUG")
- set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Ospace -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -Otime -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1)
diff --git a/Modules/Compiler/Absoft-Fortran.cmake b/Modules/Compiler/Absoft-Fortran.cmake
index 2e1666f..da1fc80 100644
--- a/Modules/Compiler/Absoft-Fortran.cmake
+++ b/Modules/Compiler/Absoft-Fortran.cmake
@@ -1,8 +1,8 @@
-set(CMAKE_Fortran_FLAGS_INIT "")
-set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "")
-set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
-set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+string(APPEND CMAKE_Fortran_FLAGS_INIT " ")
+string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " ")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
+string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
set(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=")
set(CMAKE_Fortran_MODPATH_FLAG "-p")
set(CMAKE_Fortran_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/AppleClang-DetermineCompiler.cmake b/Modules/Compiler/AppleClang-DetermineCompiler.cmake
index 397f95c..83817f7 100644
--- a/Modules/Compiler/AppleClang-DetermineCompiler.cmake
+++ b/Modules/Compiler/AppleClang-DetermineCompiler.cmake
@@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__clang__) && defined(__apple_build_version__)
include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
-set(_compiler_id_version_compute "${_compiler_id_version_compute}
+string(APPEND _compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__apple_build_version__)")
diff --git a/Modules/Compiler/Bruce-C.cmake b/Modules/Compiler/Bruce-C.cmake
index 23676ec..cfabe65 100644
--- a/Modules/Compiler/Bruce-C.cmake
+++ b/Modules/Compiler/Bruce-C.cmake
@@ -1,7 +1,7 @@
# Bruce C Compiler ignores "-g" flag and optimization cannot be
# enabled here (it is implemented only for 8086 target).
-set (CMAKE_C_FLAGS_INIT "-D__CLASSIC_C__")
-set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
-set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
-set (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
-set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_INIT " -D__CLASSIC_C__")
+string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -DNDEBUG")
diff --git a/Modules/Compiler/G95-Fortran.cmake b/Modules/Compiler/G95-Fortran.cmake
index fd84848..2c83fb8 100644
--- a/Modules/Compiler/G95-Fortran.cmake
+++ b/Modules/Compiler/G95-Fortran.cmake
@@ -1,8 +1,8 @@
-set(CMAKE_Fortran_FLAGS_INIT "")
-set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
-set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
-set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+string(APPEND CMAKE_Fortran_FLAGS_INIT " ")
+string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
+string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
set(CMAKE_Fortran_MODDIR_FLAG "-fmod=")
set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
diff --git a/Modules/Compiler/GHS-C.cmake b/Modules/Compiler/GHS-C.cmake
index 3072715..c30bdec 100644
--- a/Modules/Compiler/GHS-C.cmake
+++ b/Modules/Compiler/GHS-C.cmake
@@ -3,11 +3,11 @@ include(Compiler/GHS)
set(CMAKE_C_VERBOSE_FLAG "-v")
set(CMAKE_C_OUTPUT_EXTENSION ".o")
-set(CMAKE_C_FLAGS_INIT "")
-set(CMAKE_C_FLAGS_DEBUG_INIT "-Odebug -g")
-set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Ospace")
-set(CMAKE_C_FLAGS_RELEASE_INIT "-O")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O -g")
+string(APPEND CMAKE_C_FLAGS_INIT " ")
+string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -Odebug -g")
+string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -Ospace")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -O")
+string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -O -g")
set(CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT "-ldebug ${CMAKE_C_FLAGS_DEBUG_INIT}")
set(CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT}")
diff --git a/Modules/Compiler/GHS-CXX.cmake b/Modules/Compiler/GHS-CXX.cmake
index a51591b..b3018a7 100644
--- a/Modules/Compiler/GHS-CXX.cmake
+++ b/Modules/Compiler/GHS-CXX.cmake
@@ -3,11 +3,11 @@ include(Compiler/GHS)
set(CMAKE_CXX_VERBOSE_FLAG "-v")
set(CMAKE_CXX_OUTPUT_EXTENSION ".o")
-set(CMAKE_CXX_FLAGS_INIT "")
-set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Odebug -g")
-set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Ospace")
-set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O -g")
+string(APPEND CMAKE_CXX_FLAGS_INIT " ")
+string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -Odebug -g")
+string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -Ospace")
+string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -O")
+string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -O -g")
set(CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT
"-ldebug ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index e9c8a59..fc848ac 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -5,8 +5,8 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
# No -DNDEBUG for Fortran.
-set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
-set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
+string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
# No -isystem for Fortran because it will not find .mod files.
unset(CMAKE_INCLUDE_SYSTEM_FLAG_Fortran)
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index c2d393d..4d2fe5b 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -25,7 +25,7 @@ macro(__compiler_gnu lang)
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
endif()
- if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.2)
+ if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
endif()
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
@@ -45,11 +45,11 @@ macro(__compiler_gnu lang)
endif()
# Initial configuration flags.
- set(CMAKE_${lang}_FLAGS_INIT "")
- set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
- set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
- set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
- set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
if(NOT APPLE OR NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4) # work around #4462
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index 8c6c3f6..8c45276 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -1,6 +1,6 @@
# This file is processed when the IAR compiler is used for a C or C++ file
# Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/
-# The initial feature request is here: https://cmake.org/Bug/view.php?id=10176
+# The initial feature request is here: https://gitlab.kitware.com/cmake/cmake/issues/10176
# It also contains additional links and information.
if(_IAR_CMAKE_LOADED)
@@ -39,7 +39,8 @@ endif()
if(NOT IAR_TARGET_ARCHITECTURE)
message(FATAL_ERROR "The IAR compiler for this architecture is not yet supported "
- " by CMake. Please go to https://cmake.org/Bug and enter a feature request there.")
+ "by CMake. Please go to https://gitlab.kitware.com/cmake/cmake/issues "
+ "and enter a feature request there.")
endif()
set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
diff --git a/Modules/Compiler/Intel-ASM.cmake b/Modules/Compiler/Intel-ASM.cmake
index 74ceb0a..c2bf465 100644
--- a/Modules/Compiler/Intel-ASM.cmake
+++ b/Modules/Compiler/Intel-ASM.cmake
@@ -1,10 +1,9 @@
-set(CMAKE_ASM_VERBOSE_FLAG "-v")
+include(Compiler/Intel)
+__compiler_intel(ASM)
-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 -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG")
if(UNIX)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index edca154..1d09bd5 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -1,10 +1,9 @@
-set(CMAKE_C_VERBOSE_FLAG "-v")
+include(Compiler/Intel)
+__compiler_intel(C)
-set(CMAKE_C_FLAGS_INIT "")
-set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-set(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG")
set(CMAKE_DEPFILE_FLAGS_C "-MD -MT <OBJECT> -MF <DEPFILE>")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index 369e041..3cc4503 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -1,10 +1,9 @@
-set(CMAKE_CXX_VERBOSE_FLAG "-v")
+include(Compiler/Intel)
+__compiler_intel(CXX)
-set(CMAKE_CXX_FLAGS_INIT "")
-set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG")
set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>")
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index 671d284..ef7aa3a 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -1,10 +1,7 @@
-set(CMAKE_Fortran_FLAGS_INIT "")
-set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
-set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
-set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+include(Compiler/Intel)
+__compiler_intel(Fortran)
+
set(CMAKE_Fortran_MODDIR_FLAG "-module ")
-set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake
new file mode 100644
index 0000000..8c3942c
--- /dev/null
+++ b/Modules/Compiler/Intel.cmake
@@ -0,0 +1,36 @@
+
+#=============================================================================
+# Copyright 2002-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(__COMPILER_INTEL)
+ return()
+endif()
+set(__COMPILER_INTEL 1)
+
+if(CMAKE_HOST_WIN32)
+ # MSVC-like
+ macro(__compiler_intel lang)
+ endmacro()
+else()
+ # GNU-like
+ macro(__compiler_intel lang)
+ set(CMAKE_${lang}_VERBOSE_FLAG "-v")
+
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
+ endmacro()
+endif()
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake
index 18f141e..39aae18 100644
--- a/Modules/Compiler/NAG-Fortran.cmake
+++ b/Modules/Compiler/NAG-Fortran.cmake
@@ -33,3 +33,4 @@ set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-PIC")
+set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "-PIC")
diff --git a/Modules/Compiler/PGI-C.cmake b/Modules/Compiler/PGI-C.cmake
index da88c01..85d6e7e 100644
--- a/Modules/Compiler/PGI-C.cmake
+++ b/Modules/Compiler/PGI-C.cmake
@@ -1,4 +1,4 @@
include(Compiler/PGI)
__compiler_pgi(C)
-set(CMAKE_C_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
-set(CMAKE_C_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT} -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
diff --git a/Modules/Compiler/PGI-CXX.cmake b/Modules/Compiler/PGI-CXX.cmake
index 97c9555..896e298 100644
--- a/Modules/Compiler/PGI-CXX.cmake
+++ b/Modules/Compiler/PGI-CXX.cmake
@@ -1,4 +1,4 @@
include(Compiler/PGI)
__compiler_pgi(CXX)
-set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELEASE_INIT "${CMAKE_CXX_FLAGS_RELEASE_INIT} -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake
index 2866254..3765079 100644
--- a/Modules/Compiler/PGI-Fortran.cmake
+++ b/Modules/Compiler/PGI-Fortran.cmake
@@ -4,7 +4,7 @@ __compiler_pgi(Fortran)
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-Mnofreeform")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-Mfreeform")
-set(CMAKE_Fortran_FLAGS_INIT "${CMAKE_Fortran_FLAGS_INIT} -Mpreprocess -Kieee")
-set(CMAKE_Fortran_FLAGS_DEBUG_INIT "${CMAKE_Fortran_FLAGS_DEBUG_INIT} -Mbounds")
+string(APPEND CMAKE_Fortran_FLAGS_INIT " -Mpreprocess -Kieee")
+string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -Mbounds")
set(CMAKE_Fortran_MODDIR_FLAG "-module ")
diff --git a/Modules/Compiler/PGI.cmake b/Modules/Compiler/PGI.cmake
index 797945f..51069c2 100644
--- a/Modules/Compiler/PGI.cmake
+++ b/Modules/Compiler/PGI.cmake
@@ -23,11 +23,11 @@ macro(__compiler_pgi lang)
set(CMAKE_${lang}_VERBOSE_FLAG "-v")
# Initial configuration flags.
- set(CMAKE_${lang}_FLAGS_INIT "")
- set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g -O0")
- set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-O2 -s")
- set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-fast -O3 -Mipa=fast")
- set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -gopt")
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -O0")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O2 -s")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -fast -O3 -Mipa=fast")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -gopt")
# Preprocessing and assembly rules.
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/PathScale-C.cmake b/Modules/Compiler/PathScale-C.cmake
index 9db54af..94c7d08 100644
--- a/Modules/Compiler/PathScale-C.cmake
+++ b/Modules/Compiler/PathScale-C.cmake
@@ -1,4 +1,4 @@
include(Compiler/PathScale)
__compiler_pathscale(C)
-set(CMAKE_C_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
-set(CMAKE_C_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT} -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
diff --git a/Modules/Compiler/PathScale-CXX.cmake b/Modules/Compiler/PathScale-CXX.cmake
index 4dd7660..276b81b 100644
--- a/Modules/Compiler/PathScale-CXX.cmake
+++ b/Modules/Compiler/PathScale-CXX.cmake
@@ -1,4 +1,4 @@
include(Compiler/PathScale)
__compiler_pathscale(CXX)
-set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELEASE_INIT "${CMAKE_CXX_FLAGS_RELEASE_INIT} -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
diff --git a/Modules/Compiler/PathScale.cmake b/Modules/Compiler/PathScale.cmake
index 107f779..09ee2ba 100644
--- a/Modules/Compiler/PathScale.cmake
+++ b/Modules/Compiler/PathScale.cmake
@@ -23,9 +23,9 @@ macro(__compiler_pathscale lang)
set(CMAKE_${lang}_VERBOSE_FLAG "-v")
# Initial configuration flags.
- set(CMAKE_${lang}_FLAGS_INIT "")
- set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g -O0")
- set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Os")
- set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O3")
- set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-g -O2")
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -O0")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -g -O2")
endmacro()
diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake
index 2fa8b99..0d67400 100644
--- a/Modules/Compiler/SunPro-ASM.cmake
+++ b/Modules/Compiler/SunPro-ASM.cmake
@@ -8,11 +8,11 @@ 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 -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_INIT " ")
+string(APPEND CMAKE_ASM_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
# Initialize ASM link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index c452983..503684a 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -7,11 +7,11 @@ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h")
-set(CMAKE_C_FLAGS_INIT "")
-set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-set(CMAKE_C_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_INIT " ")
+string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index b4a5591..ce01cdd 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -7,11 +7,11 @@ set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-h")
-set(CMAKE_CXX_FLAGS_INIT "")
-set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_INIT " ")
+string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index 610e191..a0e07d4 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -10,11 +10,11 @@ set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-h")
set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG "-R")
-set(CMAKE_Fortran_FLAGS_INIT "")
-set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
+string(APPEND CMAKE_Fortran_FLAGS_INIT " ")
+string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
+string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
set(CMAKE_Fortran_MODPATH_FLAG "-M")
diff --git a/Modules/Compiler/TinyCC-C.cmake b/Modules/Compiler/TinyCC-C.cmake
index f7937ac..fbd2841 100644
--- a/Modules/Compiler/TinyCC-C.cmake
+++ b/Modules/Compiler/TinyCC-C.cmake
@@ -1,8 +1,8 @@
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
# no optimization in tcc:
-set (CMAKE_C_FLAGS_INIT "")
-set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
-set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
-set (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
-set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_INIT " ")
+string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -DNDEBUG")
diff --git a/Modules/Compiler/XL-ASM.cmake b/Modules/Compiler/XL-ASM.cmake
index 212179e..9177b39 100644
--- a/Modules/Compiler/XL-ASM.cmake
+++ b/Modules/Compiler/XL-ASM.cmake
@@ -2,11 +2,11 @@ set(CMAKE_ASM_VERBOSE_FLAG "-V")
# -qthreaded = Ensures that all optimizations will be thread-safe
# -qhalt=e = Halt on error messages (rather than just severe errors)
-set(CMAKE_ASM_FLAGS_INIT "-qthreaded -qhalt=e -qsourcetype=assembler")
+string(APPEND CMAKE_ASM_FLAGS_INIT " -qthreaded -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 -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -O -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -O -DNDEBUG")
+string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -g -DNDEBUG")
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake
index 97dd017..f976c99 100644
--- a/Modules/Compiler/XL-C.cmake
+++ b/Modules/Compiler/XL-C.cmake
@@ -1,8 +1,8 @@
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")
+string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
+string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
# -qthreaded = Ensures that all optimizations will be thread-safe
# -qhalt=e = Halt on error messages (rather than just severe errors)
-set(CMAKE_C_FLAGS_INIT "-qthreaded -qhalt=e")
+string(APPEND CMAKE_C_FLAGS_INIT " -qthreaded -qhalt=e")
diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake
index 41372c1..545d657 100644
--- a/Modules/Compiler/XL-CXX.cmake
+++ b/Modules/Compiler/XL-CXX.cmake
@@ -1,11 +1,11 @@
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")
+string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
+string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
# -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")
+string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded -qhalt=e")
set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index ae9df4e..6bab6f6 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -10,7 +10,7 @@ set(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
# -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")
+string(APPEND CMAKE_Fortran_FLAGS_INIT " -qthreaded -qhalt=e")
# xlf: 1501-214 (W) command option E reserved for future use - ignored
set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake
index bf4f554..1f2b145 100644
--- a/Modules/Compiler/XL.cmake
+++ b/Modules/Compiler/XL.cmake
@@ -29,10 +29,10 @@ macro(__compiler_xl lang)
set(CMAKE_${lang}_VERBOSE_FLAG "-V")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-qpic")
- 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")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -g")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")