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.
This commit is contained in:
parent
31d7a0f2e3
commit
55d7aa4c44
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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" )
|
||||
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue