1
0
mirror of https://github.com/eclipse/mosquitto.git synced 2025-05-08 08:40:13 +08:00

Fix pthreads linking on Windows for libmosquitto_static

Closes #3143
This commit is contained in:
Roger A. Light 2024-10-30 17:09:37 +00:00
parent e99a97b294
commit 67ef993d23
2 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,14 @@
2.0.21 - 2024-xx-xx
===================
Client library:
- Fix threads linking on Windows for static libmosquitto library
Closes #3143
Build:
- Fix Windows builds not having websockets enabled.
2.0.20 - 2024-10-16
===================

View File

@ -89,19 +89,19 @@ set_target_properties(libmosquitto PROPERTIES
POSITION_INDEPENDENT_CODE 1
)
target_link_libraries(libmosquitto PRIVATE ${LIBRARIES})
if (WITH_THREADING)
if(WIN32)
target_link_libraries(libmosquitto PRIVATE PThreads4W::PThreads4W)
set (LIBRARIES ${LIBRARIES} PThreads4W::PThreads4W)
else()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(libmosquitto PRIVATE Threads::Threads)
set (LIBRARIES ${LIBRARIES} Threads::Threads)
endif()
endif()
target_link_libraries(libmosquitto PRIVATE ${LIBRARIES})
set_target_properties(libmosquitto PROPERTIES
OUTPUT_NAME mosquitto
VERSION ${VERSION}