Skip to content

Commit

Permalink
Simplify cmake threads detection on Windows
Browse files Browse the repository at this point in the history
Requires cmake 3.1.
  • Loading branch information
ralight committed Feb 24, 2022
1 parent ffe952f commit 74814cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
17 changes: 4 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# To configure the build options either use the CMake gui, or run the command
# line utility including the "-i" option.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.1)
cmake_policy(SET CMP0042 NEW)

project(mosquitto)
Expand Down Expand Up @@ -67,18 +67,9 @@ option(WITH_THREADING "Include client library threading support?" ON)
if (WITH_THREADING)
add_definitions("-DWITH_THREADING")
if (WIN32)
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CL_64)
set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x64\\pthreadVC2.lib)
else (CMAKE_CL_64)
set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
endif (CMAKE_CL_64)
set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
else()
find_package(Threads REQUIRED)
set (PTHREAD_LIBRARIES Threads::Threads)
set (PTHREAD_INCLUDE_DIR "")
endif()
find_package(Threads REQUIRED)
set (PTHREAD_LIBRARIES Threads::Threads)
set (PTHREAD_INCLUDE_DIR "")
elseif (ANDROID)
set (PTHREAD_LIBRARIES "")
set (PTHREAD_INCLUDE_DIR "")
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Broker:
MOSQ_EVT_MESSAGE.
- Fix bridge `restart_timeout` not being honoured.

Client library:
- Fix threads library detection on Windows under cmake. Bumps the minimum
cmake version to 3.1, which is still ancient.


2.0.14 - 2021-11-17
===================
Expand Down

0 comments on commit 74814cc

Please sign in to comment.