From d51afbe19dcf0c190b79bb4a31a0eb51919b7ee8 Mon Sep 17 00:00:00 2001 From: Conn O'Griofa Date: Mon, 9 Jan 2023 00:06:56 +0000 Subject: [PATCH] CMake: win32: fix API version, disable boost-cmake detection (#732) --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54303f01..e1690e74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,11 @@ pkg_check_modules (CURL REQUIRED libcurl) if(NOT APPLE) set(Boost_USE_STATIC_LIBS ON) # cmake-lint: disable=C0103 endif() +if(WIN32) + # workaround to prevent link errors against icudata, icui18n + set(Boost_NO_BOOST_CMAKE ON) # cmake-lint: disable=C0103 +endif() + find_package(Boost COMPONENTS log filesystem program_options REQUIRED) list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-missing-braces -Wno-maybe-uninitialized -Wno-sign-compare) @@ -79,10 +84,6 @@ if(WIN32) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CURL_STATIC_LDFLAGS} ${CURL_STATIC_CFLAGS}") - # WORKAROUND: /mingw64/include/_mingw.h r186 defines _WIN32_WINNT=0x601, but boost - # is built against version 0x603 (BOOST_WINAPI_VERSION_WINBLUE) from r157 header. - ADD_DEFINITIONS(-DBOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WINBLUE) - add_compile_definitions(SUNSHINE_PLATFORM="windows") add_subdirectory(tools) # This is temporary, only tools for Windows are needed, for now