aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-08-25 15:06:56 +0200
committerAndreas Schneider <mail@cynapses.org>2009-08-25 15:06:56 +0200
commitb8508020e5e417a7500df19b8ee4cb73500c72d5 (patch)
treec91901012deb60a30e6b63a64c70ff2a30d033bc /cmake
parent324be0eabd386478caf3acdd34a434041ad5e365 (diff)
downloadlibssh-b8508020e5e417a7500df19b8ee4cb73500c72d5.tar.gz
libssh-b8508020e5e417a7500df19b8ee4cb73500c72d5.tar.xz
libssh-b8508020e5e417a7500df19b8ee4cb73500c72d5.zip
Link shared libraries with --as-needed by default.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/DefineCompilerFlags.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/Modules/DefineCompilerFlags.cmake b/cmake/Modules/DefineCompilerFlags.cmake
index c6531f6..8ef642e 100644
--- a/cmake/Modules/DefineCompilerFlags.cmake
+++ b/cmake/Modules/DefineCompilerFlags.cmake
@@ -46,10 +46,13 @@ if (UNIX AND NOT WIN32)
if (WITH_FORTIFY_SOURCE)
add_definitions(-D_FORTIFY_SOURCE=2)
endif (WITH_FORTIFY_SOURCE)
+
+ # Set linker flags
+ set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
endif (CMAKE_COMPILER_IS_GNUCC)
endif (UNIX AND NOT WIN32)
# suppress warning about "deprecated" functions
-if(MSVC)
-add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-endif(MSVC)
+if (MSVC)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+endif (MSVC)