diff --git a/CMakeLists.txt b/CMakeLists.txt index 1eeb4cb..28bb03e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,14 +136,14 @@ if (WINDOWS) endif (WINDOWS) if (NOT WINDOWS) - set(_LINKS ${_LINKS} -lbfd -ldl) + set(_LINKS -lbfd -ldl ${_LINKS}) endif () if (STATICC) set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") message(STATUS "Linking C library statically") - set(_LINKS ${_LINKS} -lpthread -static-libgcc -static-libstdc++ -Wl,-Bstatic -lm -lstdc++) - SET(_TESTLINKS ${_TESTLINKS} -lpthread -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++) + set(_LINKS ${_LINKS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lm -lstdc++ -lpthread -Wl,-Bdynamic) + SET(_TESTLINKS ${_TESTLINKS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic) else() SET(_LINKS ${_LINKS} Threads::Threads) endif()