Link pthreads when linking statically.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2020-09-29 18:52:58 +02:00
parent 1686434440
commit 2c7082a728
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_link_options(-fuse-ld=lld)
endif ()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if (WINDOWS)
SET(CMAKE_SYSTEM_NAME Windows)
ADD_DEFINITIONS(-D WINDOWS=1)
@ -127,7 +130,7 @@ endif ()
if (STATICC)
message(STATUS "Linking C library statically")
SET(_LINKS ${_LINKS} -static-libgcc -static-libstdc++)
SET(_LINKS ${_LINKS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread)
endif()
target_link_libraries(pkmnLib PUBLIC ${_LINKS})