From a1f3faedab339d4f47670d9d3ddd48e565aeac68 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sat, 4 Jan 2025 14:28:50 +0100 Subject: [PATCH] depends: add CMAKE_SYSTEM_VERSION to toolchain file, set minimum Windows version --- contrib/depends/Makefile | 1 + contrib/depends/funcs.mk | 3 +++ contrib/depends/hosts/mingw32.mk | 1 + contrib/depends/packages/unbound.mk | 1 - contrib/depends/toolchain.cmake.in | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile index 5f93075db..8dfd9e8d9 100644 --- a/contrib/depends/Makefile +++ b/contrib/depends/Makefile @@ -152,6 +152,7 @@ $(host_prefix)/share/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_ -e 's|@release_type@|$(cmake_release_type)|' \ -e 's|@build_tests@|$(build_tests)|' \ -e 's|@cmake_system_name@|$($(host_os)_cmake_system)|' \ + -e 's|@cmake_system_version@|$($(host_os)_cmake_system_version)|' \ -e 's|@prefix@|$($(host_arch)_$(host_os)_prefix)|'\ -e 's|@arch@|$(host_arch)|'\ $< > $@ diff --git a/contrib/depends/funcs.mk b/contrib/depends/funcs.mk index 6970ddf25..70b284861 100644 --- a/contrib/depends/funcs.mk +++ b/contrib/depends/funcs.mk @@ -200,6 +200,9 @@ ifneq ($(host),$(build)) $(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) $(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) $(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) +ifneq ($($(host_os)_cmake_system_version),) +$(1)_cmake += -DCMAKE_SYSTEM_VERSION=$($(host_os)_cmake_system_version) +endif endif endif endef diff --git a/contrib/depends/hosts/mingw32.mk b/contrib/depends/hosts/mingw32.mk index 58a9a929d..2eb5fbda0 100644 --- a/contrib/depends/hosts/mingw32.mk +++ b/contrib/depends/hosts/mingw32.mk @@ -11,3 +11,4 @@ mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC mingw32_cmake_system=Windows +mingw32_cmake_system_version=10.0 diff --git a/contrib/depends/packages/unbound.mk b/contrib/depends/packages/unbound.mk index 254636bca..f1c600d62 100644 --- a/contrib/depends/packages/unbound.mk +++ b/contrib/depends/packages/unbound.mk @@ -15,7 +15,6 @@ define $(package)_set_vars $(package)_config_opts_w64=--enable-static-exe --sysconfdir=/etc --prefix=$(host_prefix) --target=$(host_prefix) $(package)_config_opts_x86_64_darwin=ac_cv_func_SHA384_Init=yes $(package)_build_opts_mingw32=LDFLAGS="$($(package)_ldflags) -lpthread" - $(package)_cflags_mingw32+="-D_WIN32_WINNT=0x600" endef define $(package)_preprocess_cmds diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in index eb0da1877..9a3ebcb1b 100644 --- a/contrib/depends/toolchain.cmake.in +++ b/contrib/depends/toolchain.cmake.in @@ -1,5 +1,6 @@ # Set the system name to one of Android, Darwin, FreeBSD, Linux, or Windows SET(CMAKE_SYSTEM_NAME @cmake_system_name@) +SET(CMAKE_SYSTEM_VERSION @cmake_system_version@) SET(CMAKE_SYSTEM_PROCESSOR @arch@) SET(CMAKE_BUILD_TYPE @release_type@)