diff --git a/CMakeLists.txt b/CMakeLists.txt index 57f9f49..6bd02ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,7 +133,13 @@ find_package(Threads REQUIRED) if (STATICC) message(STATUS "Linking C library statically") - SET(_LINKS ${_LINKS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread) + if (NOT UNIX AND NOT APPLE) + SET(_LINKS ${_LINKS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread) + SET(_TESTLINKS ${_TESTLINKS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread) + else() + SET(_LINKS ${_LINKS} Threads::Threads -static-libgcc -static-libstdc++) + SET(_TESTLINKS ${_TESTLINKS} Threads::Threads -static-libgcc -static-libstdc++) + endif() else() SET(_LINKS ${_LINKS} Threads::Threads) endif()