[cmake-commits] king committed Linux.cmake 1.10 1.11

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Sep 15 14:08:43 EDT 2006


Update of /cvsroot/CMake/CMake/Modules/Platform
In directory public:/mounts/ram/cvs-serv802/Modules/Platform

Modified Files:
	Linux.cmake 
Log Message:
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.


Index: Linux.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Linux.cmake,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Linux.cmake	1 Aug 2006 19:36:49 -0000	1.10
+++ Linux.cmake	15 Sep 2006 18:08:39 -0000	1.11
@@ -8,4 +8,14 @@
 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)



More information about the Cmake-commits mailing list