From e9395f71b8c0728b7be25c91277609e9cb22ce08 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 12 Feb 2022 12:41:51 +0100 Subject: [PATCH] Only statically link libm and pthread on Windows --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c00aa6..6745d5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,11 @@ if (STATICC) set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") set(LINKS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lm -lstdc++ -lpthread -Wl,-Bdynamic ${LINKS}) endif(STATICC) + +if (WINDOWS) + set(LINKS ${LINKS} -Wl,-Bstatic -lm -lstdc++ -lpthread -Wl,-Bdynamic) +endif() + target_link_libraries(Arbutils ${LINKS}) if (ARBUTILS_TESTS)