From 7532e4d94daebafabd3b7d5977eb4b0f33622bf7 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c00aa6..62bf5c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,8 +86,13 @@ endif() if (STATICC) message("Linking dependencies statically.") set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") - set(LINKS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lm -lstdc++ -lpthread -Wl,-Bdynamic ${LINKS}) + set(LINKS -static-libgcc -static-libstdc++ ${LINKS}) endif(STATICC) + +if (WINDOWS) + set(LINKS ${LINKS} -Wl,-Bstatic -lm -lstdc++ -lpthread -Wl,-Bdynamic) +endif() + target_link_libraries(Arbutils ${LINKS}) if (ARBUTILS_TESTS)