summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
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/Platform
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/Platform')
-rw-r--r--Modules/Platform/Linux.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index 9174eb6..498e491 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -8,4 +8,14 @@ SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,")
SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-soname,")
+
+# Initialize C 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_C_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+ENDFOREACH(type)
+
INCLUDE(Platform/UnixPaths)