From 76da30adda5fae217eac5165a56549e29c4665aa Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Thu, 23 Sep 2010 23:36:25 +0200 Subject: [PATCH] Pass -Wl,--no-add-needed to the linker. --- CMakeLists.txt | 2 ++ tests/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40636f052..5c02fec6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,8 @@ if(CMAKE_COMPILER_IS_GNUCXX) add_definitions(-DQT_NO_KEYWORDS -DQT_NO_EXCEPTIONS -fno-exceptions -fno-rtti -ansi -Wall -Wextra -Wundef -Wold-style-cast -Wnon-virtual-dtor -Wcast-align -Wpointer-arith -Wformat-security -Woverloaded-virtual -Wno-long-long) + + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-add-needed") endif(CMAKE_COMPILER_IS_GNUCXX) if( APPLE OR MINGW ) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0a1ceb627..8afcade99 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -84,7 +84,7 @@ add_unit_test( testcryptohash TestCryptoHash.cpp ) target_link_libraries( testcryptohash keepassx_core ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${LIBGCRYPT_LIBS} ${ZLIB_LIBRARIES} ) add_unit_test( testsymmetriccipher TestSymmetricCipher.cpp ) -target_link_libraries( testsymmetriccipher keepassx_core ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${LIBGCRYPT_LIBS} ) +target_link_libraries( testsymmetriccipher keepassx_core ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${LIBGCRYPT_LIBS} ${ZLIB_LIBRARIES} ) add_unit_test( testhashedblockstream TestHashedBlockStream.cpp ) -target_link_libraries( testhashedblockstream keepassx_core ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${LIBGCRYPT_LIBS} ) +target_link_libraries( testhashedblockstream keepassx_core ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${LIBGCRYPT_LIBS} ${ZLIB_LIBRARIES} )