From 002d550b8068b80e02104d4afab492dae7a7a3e3 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 11 Dec 2020 12:44:09 +0100 Subject: [PATCH] Further fixes for linker issue. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()