diff --git a/CMakeLists.txt b/CMakeLists.txt index cda6c42e8..d50795a83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -708,7 +708,10 @@ set(GAME_GENERATED_SHARED set(DEPS ${DEP_JSON} ${DEP_MD5} ${ZLIB_DEP}) # Libraries -set(LIBS ${CMAKE_THREAD_LIBS_INIT} ${CURL_LIBRARIES} ${CRYPTO_LIBRARIES} ${WEBSOCKETS_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_LIBS}) +set(LIBS ${CURL_LIBRARIES} ${CRYPTO_LIBRARIES} ${WEBSOCKETS_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_LIBS}) +# Add pthreads (on non-Windows) at the end, so that other libraries can depend +# on it. +list(APPEND LIBS ${CMAKE_THREAD_LIBS_INIT}) # Targets add_library(engine-shared EXCLUDE_FROM_ALL OBJECT ${ENGINE_INTERFACE} ${ENGINE_SHARED} ${ENGINE_GENERATED_SHARED} ${BASE})