summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-05-30 08:52:35 (GMT)
committerBrad King <brad.king@kitware.com>2012-06-12 19:38:48 (GMT)
commit55d7aa4c44d78322df76679db768154568e51385 (patch)
tree229e243a01dc628b519a34d76216fd4c3f43237a
parent31d7a0f2e3a717435da9660bcb2c23654171afda (diff)
downloadCMake-55d7aa4c44d78322df76679db768154568e51385.zip
CMake-55d7aa4c44d78322df76679db768154568e51385.tar.gz
CMake-55d7aa4c44d78322df76679db768154568e51385.tar.bz2
Add platform variable for flags specific to shared libraries
Store in CMAKE_${lang}_COMPILE_OPTIONS_DLL flags from CMAKE_SHARED_LIBRARY_${lang}_FLAGS that are truly exclusive to shared libraries.
-rw-r--r--Modules/CMakeCXXInformation.cmake4
-rw-r--r--Modules/CMakeFortranInformation.cmake4
-rw-r--r--Modules/Compiler/SCO.cmake1
-rw-r--r--Modules/Platform/Windows-Embarcadero.cmake3
-rw-r--r--Modules/Platform/Windows-wcl386.cmake3
-rw-r--r--Tests/SystemInformation/SystemInformation.in2
6 files changed, 15 insertions, 2 deletions
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 5e09eab..9dc9cbd 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -108,6 +108,10 @@ IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
SET(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
+IF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
+ SET(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
+ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
+
IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 9c82409..d962f4c 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -82,6 +82,10 @@ IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
SET(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
+IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
+ SET(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
+ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
+
# Create a set of shared library variable specific to Fortran
# For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version
diff --git a/Modules/Compiler/SCO.cmake b/Modules/Compiler/SCO.cmake
index ef2f64b..f673c8f 100644
--- a/Modules/Compiler/SCO.cmake
+++ b/Modules/Compiler/SCO.cmake
@@ -22,6 +22,7 @@ macro(__compiler_sco lang)
# Feature flags.
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -Kpic)
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE -Kpie)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_DLL -belf)
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-Kpic -belf")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-belf -Wl,-Bexport")
endmacro()
diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake
index 87b3767..62e8eb7 100644
--- a/Modules/Platform/Windows-Embarcadero.cmake
+++ b/Modules/Platform/Windows-Embarcadero.cmake
@@ -76,7 +76,8 @@ SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_R
macro(__embarcadero_language lang)
- set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_DLL "${_tD}") # Note: This variable is a ';' separated list
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}") # ... while this is a space separated string.
# compile a source file into an object file
# place <DEFINES> outside the response file because Borland refuses
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index e1140df..14b3b81 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -20,7 +20,8 @@ SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )
SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
-set (CMAKE_SHARED_LIBRARY_C_FLAGS "-bd" )
+set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-bd") # ... while this is a space separated string.
SET(CMAKE_RC_COMPILER "rc" )
diff --git a/Tests/SystemInformation/SystemInformation.in b/Tests/SystemInformation/SystemInformation.in
index 8840bbf..ecbc054 100644
--- a/Tests/SystemInformation/SystemInformation.in
+++ b/Tests/SystemInformation/SystemInformation.in
@@ -32,6 +32,7 @@ CMAKE_SHARED_LIBRARY_LINK_STATIC_C_FLAGS == "${CMAKE_SHARED_LIBRARY_LINK_STATIC_
CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_C_FLAGS == "${CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_C_FLAGS}"
CMAKE_C_COMPILE_OPTIONS_PIC == "${CMAKE_C_COMPILE_OPTIONS_PIC}"
CMAKE_C_COMPILE_OPTIONS_PIE == "${CMAKE_C_COMPILE_OPTIONS_PIE}"
+CMAKE_C_COMPILE_OPTIONS_DLL == "${CMAKE_C_COMPILE_OPTIONS_DLL}"
// C shared module flags
CMAKE_SHARED_MODULE_C_FLAGS == "${CMAKE_SHARED_MODULE_C_FLAGS}"
@@ -53,6 +54,7 @@ CMAKE_SHARED_LIBRARY_LINK_STATIC_CXX_FLAGS == "${CMAKE_SHARED_LIBRARY_LINK_STATI
CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_CXX_FLAGS == "${CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_CXX_FLAGS}"
CMAKE_CXX_COMPILE_OPTIONS_PIC == "${CMAKE_CXX_COMPILE_OPTIONS_PIC}"
CMAKE_CXX_COMPILE_OPTIONS_PIE == "${CMAKE_CXX_COMPILE_OPTIONS_PIE}"
+CMAKE_CXX_COMPILE_OPTIONS_DLL == "${CMAKE_CXX_COMPILE_OPTIONS_DLL}"
// CXX shared module flags
CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS == "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS}"