Ensure `_WIN32_WINNT` is set for Boost.Process

Apparently is is not always set when using MSVC (not sure in which cases it
is missing).
This commit is contained in:
Martchus 2023-05-01 20:58:40 +02:00
parent e9135d735a
commit 208391acf7
1 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,12 @@ if (USE_BOOST_PROCESS)
SOURCE syncthingprocess.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS BOOST_USE_WINDOWS_H WIN32_LEAN_AND_MEAN)
elseif (MSVC)
# prevent "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately."
set_property(
SOURCE syncthingprocess.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS _WIN32_WINNT=0x0601)
endif ()
# add threading library as it is needed by Boost.Process
use_package(TARGET_NAME Threads::Threads PACKAGE_NAME Threads PACKAGE_ARGS REQUIRED)