diff --git a/CMakeLists.txt b/CMakeLists.txt index ab5e089..bfb0a68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,12 +84,13 @@ endif (WINDOWS) # Set up links to all relevant libraries. SET(_LIBRARYLINKS Arbutils) if (NOT WINDOWS) - set(_LIBRARYLINKS ${_LIBRARYLINKS} -ldw) + set(_LIBRARYLINKS ${_LIBRARYLINKS} -lbfd -ldl) endif () # If we need to link the C libraries statically, do so. if (STATICC) message(STATUS "Linking C statically.") + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") SET(_LIBRARYLINKS ${_LIBRARYLINKS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread) endif ()