Only link pthread statically on Windows.
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Deukhoofd 2021-10-23 16:05:35 +02:00
parent 76b7257fdf
commit ae3021dd64
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 4 deletions

View File

@ -132,8 +132,8 @@ if (WINDOWS)
if (SHARED)
set_target_properties(pkmnLib PROPERTIES SUFFIX ".dll")
endif (SHARED)
set(_LINKS ${_LINKS} -Wl,-Bstatic -lws2_32 -Wl,-Bdynamic)
set(_TESTLINKS ${_TESTLINKS} -Wl,-Bstatic -lws2_32 -Wl,-Bdynamic)
set(_LINKS ${_LINKS} -Wl,-Bstatic -lws2_32 -lpthread -Wl,-Bdynamic)
set(_TESTLINKS ${_TESTLINKS} -Wl,-Bstatic -lws2_32 -lpthread -Wl,-Bdynamic)
endif (WINDOWS)
if (NOT WINDOWS)
@ -144,9 +144,9 @@ if (STATICC)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
message(STATUS "Linking C library statically")
set(_LINKS ${_LINKS} -Wl,-Bstatic -lm -lgcc -lstdc++ -lpthread -Wl,-Bdynamic)
SET(_TESTLINKS ${_TESTLINKS} -Wl,-Bstatic -lm -lgcc -lstdc++ -lpthread -Wl,-Bdynamic)
SET(_TESTLINKS ${_TESTLINKS} -Wl,-Bstatic -lm -lgcc -lstdc++ -Wl,-Bdynamic)
else ()
SET(_LINKS ${_LINKS} -Wl,--whole-archive -lpthread -Wl,--no-whole-archive)
SET(_LINKS ${_LINKS} -Wl,--whole-archive -Wl,--no-whole-archive)
endif ()
target_link_libraries(pkmnLib PRIVATE ${_LINKS})