From 9fcef3c45bd936b7da20679a1bb160c22f4945ff Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 7 Dec 2009 02:16:05 +0100 Subject: 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) --- libmysql/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libmysql/CMakeLists.txt') 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) -- cgit v1.2.1