diff --git a/CMakeLists.txt b/CMakeLists.txt index 750e86c..d004496 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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})