summaryrefslogtreecommitdiff
path: root/libmysql/CMakeLists.txt
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@koala>2009-12-07 02:16:05 +0100
committerVladislav Vaintroub <vvaintroub@koala>2009-12-07 02:16:05 +0100
commita1ebd4245e9158b8fb242a49e9aeb6a0840fc92e (patch)
treebe34c035a12551aff48f3bcdb4fcbf4754f8b3f0 /libmysql/CMakeLists.txt
parent555c99c8eb9dc1371df13af029c42e98e59756c0 (diff)
downloadmariadb-git-a1ebd4245e9158b8fb242a49e9aeb6a0840fc92e.tar.gz
On Linux, support -Wl,--no-undefined (only client shared library)
and --Wl,--as-needed (all shared modules). The later will remove unused dependencies (also from gcc and C++ runtime)
Diffstat (limited to 'libmysql/CMakeLists.txt')
-rwxr-xr-xlibmysql/CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index efd6d553be4..db7d2ee2468 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -167,7 +167,14 @@ IF(NOT DISABLE_SHARED)
OUTPUT_NAME mysqlclient
VERSION "${SHARED_LIB_MAJOR_VERSION}.0.0"
SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
-
+ IF(LINK_FLAG_NO_UNDEFINED)
+ GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
+ IF(NOT libmysql_link_flag)
+ SET(libmysql_link_flags)
+ ENDIF()
+ SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
+ "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED}")
+ ENDIF()
# clean direct output needs to be set several targets have the same name
#(mysqlclient in this case)
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1)