From 67ef993d238429e1573cd6d018baa59e8373f141 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 30 Oct 2024 17:09:37 +0000 Subject: [PATCH] Fix pthreads linking on Windows for libmosquitto_static Closes #3143 --- ChangeLog.txt | 11 +++++++++++ lib/CMakeLists.txt | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0c724cb27..0b706d90b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -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 =================== diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index fc06a9995..646d0ea97 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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}