summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCXXInformation.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-09-15 18:09:10 (GMT)
committerBrad King <brad.king@kitware.com>2006-09-15 18:09:10 (GMT)
commit1d0502927c32cb3a14c101da16d7ab97901dc2a2 (patch)
treea42fea8061717baf973c3d1588f7ca0f136aa3d1 /Modules/CMakeCXXInformation.cmake
parent429571bd1f35541f1d5c64d3d46bdc2e6b0a95ac (diff)
downloadCMake-1d0502927c32cb3a14c101da16d7ab97901dc2a2.zip
CMake-1d0502927c32cb3a14c101da16d7ab97901dc2a2.tar.gz
CMake-1d0502927c32cb3a14c101da16d7ab97901dc2a2.tar.bz2
ENH: Adding support to link specifically to an archive or a shared library based on the file name specified. This fixes the problem of having -lfoo linking to libfoo.so even when it came from libfoo.a being specified.
Diffstat (limited to 'Modules/CMakeCXXInformation.cmake')
-rw-r--r--Modules/CMakeCXXInformation.cmake16
1 files changed, 12 insertions, 4 deletions
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 8d05933..4e03bf3 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -72,10 +72,6 @@ IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
-IF(NOT CMAKE_SHARED_MODULE_LINK_CXX_FLAGS)
- SET(CMAKE_SHARED_MODULE_LINK_CXX_FLAGS ${CMAKE_SHARED_MODULE_LINK_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_LINK_CXX_FLAGS)
-
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG)
SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_FLAG})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG)
@@ -84,6 +80,18 @@ IF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP)
SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP)
+# Initialize CXX link type selection flags from C versions.
+FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ IF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
+ SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
+ ${CMAKE_${type}_LINK_STATIC_C_FLAGS})
+ ENDIF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
+ IF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
+ SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
+ ${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
+ ENDIF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
+ENDFOREACH(type)
+
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time