From f7c84fcd7f8478af6fa22462f703cb2736b64933 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/toolchain.cmake.in | 1 + 4 files changed, 6 insertions(+) diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile index 5f93075db51..8dfd9e8d9ce 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 6970ddf2571..70b284861b0 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 58a9a929de0..2eb5fbda02a 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/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in index eb0da1877d9..613ee911bc0 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 @host_system_version@) SET(CMAKE_SYSTEM_PROCESSOR @arch@) SET(CMAKE_BUILD_TYPE @release_type@)