Skip to content

Commit

Permalink
fix linking for threaded broker
Browse files Browse the repository at this point in the history
Signed-off-by: Flávio Tapajós <[email protected]>
  • Loading branch information
ftapajos committed Sep 16, 2024
1 parent f60d10a commit 3b269af
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ if (WITH_WEBSOCKETS)
endif (STATIC_WEBSOCKETS)
endif (WITH_WEBSOCKETS)

if (WITH_THREADING)
if(WIN32)
set (MOSQ_LIBS ${MOSQ_LIBS} PThreads4W::PThreads4W)
else()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set (MOSQ_LIBS ${MOSQ_LIBS} Threads::Threads)
endif()
endif()

add_executable(mosquitto ${MOSQ_SRCS})
target_link_libraries(mosquitto ${MOSQ_LIBS})
if (WIN32)
Expand Down

0 comments on commit 3b269af

Please sign in to comment.