From 93c3e972d5cd6206942d178be8454f8c41d2b972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=9A=93?= Date: Wed, 2 Apr 2025 13:09:41 -0400 Subject: [PATCH 1/2] Fix builds with CMake 4 --- linux/Makefile | 2 ++ macos/Dependencies/common.make | 1 + windows/Makefile | 2 ++ 3 files changed, 5 insertions(+) diff --git a/linux/Makefile b/linux/Makefile index 3ee14767..8eee5350 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -33,6 +33,7 @@ ifdef ARCH_CMAKE_TOOLCHAIN ARCH_CMAKE_ARGS := -DCMAKE_TOOLCHAIN_FILE="${PWD}/$(ARCH_CMAKE_TOOLCHAIN)" endif CMAKE_ARGS := \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.10 \ -DCMAKE_INSTALL_PREFIX="$(BUILD_PREFIX)" \ -DCMAKE_PREFIX_PATH="$(BUILD_PREFIX)" \ -DCMAKE_C_FLAGS="$(CFLAGS)" \ @@ -302,6 +303,7 @@ $(DOWNLOADS)/fluidsynth/cmakebuild/Makefile: $(DOWNLOADS)/fluidsynth/CMakeLists. $(DOWNLOADS)/fluidsynth/CMakeLists.txt: $(CLONE) $(GITHUB)/mkxp-z/fluidsynth-sans-glib $(DOWNLOADS)/fluidsynth + sed -i 's/"$${CMAKE_COMMAND}" -D/"$${CMAKE_COMMAND}" -DCMAKE_POLICY_VERSION_MINIMUM=3.10 -D/g' $(DOWNLOADS)/fluidsynth/src/CMakeLists.txt # OpenSSL openssl: init_dirs $(LIBDIR)/libssl.a diff --git a/macos/Dependencies/common.make b/macos/Dependencies/common.make index f11623f5..6203c8f0 100644 --- a/macos/Dependencies/common.make +++ b/macos/Dependencies/common.make @@ -31,6 +31,7 @@ CONFIGURE_ARGS := \ --host=$(HOST) CMAKE_ARGS := \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.10 \ -DCMAKE_INSTALL_PREFIX="$(BUILD_PREFIX)" \ -DCMAKE_PREFIX_PATH="$(BUILD_PREFIX)" \ -DCMAKE_OSX_ARCHITECTURES=$(ARCH) \ diff --git a/windows/Makefile b/windows/Makefile index 11b2327c..a46e75c9 100755 --- a/windows/Makefile +++ b/windows/Makefile @@ -29,6 +29,7 @@ CONFIGURE_ENV := \ CONFIGURE_ARGS := --prefix="$(BUILD_PREFIX)" CMAKE_ARGS := \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.10 \ -DCMAKE_INSTALL_PREFIX="$(BUILD_PREFIX)" \ -DCMAKE_PREFIX_PATH="$(BUILD_PREFIX)" \ -DCMAKE_C_FLAGS="$(CFLAGS)" \ @@ -282,6 +283,7 @@ $(DOWNLOADS)/fluidsynth/cmakebuild/Makefile: $(DOWNLOADS)/fluidsynth/CMakeLists. $(DOWNLOADS)/fluidsynth/CMakeLists.txt: $(CLONE) $(GITHUB)/mkxp-z/fluidsynth-sans-glib $(DOWNLOADS)/fluidsynth + sed -i 's/"$${CMAKE_COMMAND}" -D/"$${CMAKE_COMMAND}" -DCMAKE_POLICY_VERSION_MINIMUM=3.10 -D/g' $(DOWNLOADS)/fluidsynth/src/CMakeLists.txt # OpenSSL openssl: init_dirs $(LIBDIR)/libssl.a From 97235e068a5669fe38aea7c2f20ba321dfb4877c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=9A=93?= Date: Thu, 1 May 2025 17:55:38 -0400 Subject: [PATCH 2/2] Use environment variable to set CMake policy instead of -D flag This applies recursively unlike the other method. --- linux/Makefile | 3 +-- macos/Dependencies/common.make | 2 +- windows/Makefile | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index 8eee5350..5a717360 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -24,6 +24,7 @@ CLONE := $(GIT) clone -q GITHUB := https://github.com CONFIGURE_ENV := \ + CMAKE_POLICY_VERSION_MINIMUM=3.10 \ PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) \ CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" @@ -33,7 +34,6 @@ ifdef ARCH_CMAKE_TOOLCHAIN ARCH_CMAKE_ARGS := -DCMAKE_TOOLCHAIN_FILE="${PWD}/$(ARCH_CMAKE_TOOLCHAIN)" endif CMAKE_ARGS := \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.10 \ -DCMAKE_INSTALL_PREFIX="$(BUILD_PREFIX)" \ -DCMAKE_PREFIX_PATH="$(BUILD_PREFIX)" \ -DCMAKE_C_FLAGS="$(CFLAGS)" \ @@ -303,7 +303,6 @@ $(DOWNLOADS)/fluidsynth/cmakebuild/Makefile: $(DOWNLOADS)/fluidsynth/CMakeLists. $(DOWNLOADS)/fluidsynth/CMakeLists.txt: $(CLONE) $(GITHUB)/mkxp-z/fluidsynth-sans-glib $(DOWNLOADS)/fluidsynth - sed -i 's/"$${CMAKE_COMMAND}" -D/"$${CMAKE_COMMAND}" -DCMAKE_POLICY_VERSION_MINIMUM=3.10 -D/g' $(DOWNLOADS)/fluidsynth/src/CMakeLists.txt # OpenSSL openssl: init_dirs $(LIBDIR)/libssl.a diff --git a/macos/Dependencies/common.make b/macos/Dependencies/common.make index 6203c8f0..2bd90e29 100644 --- a/macos/Dependencies/common.make +++ b/macos/Dependencies/common.make @@ -23,6 +23,7 @@ endif CONFIGURE_ENV := \ $(DEPLOYMENT_TARGET_ENV) \ + CMAKE_POLICY_VERSION_MINIMUM=3.10 \ PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) \ CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" @@ -31,7 +32,6 @@ CONFIGURE_ARGS := \ --host=$(HOST) CMAKE_ARGS := \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.10 \ -DCMAKE_INSTALL_PREFIX="$(BUILD_PREFIX)" \ -DCMAKE_PREFIX_PATH="$(BUILD_PREFIX)" \ -DCMAKE_OSX_ARCHITECTURES=$(ARCH) \ diff --git a/windows/Makefile b/windows/Makefile index a46e75c9..72a72c59 100755 --- a/windows/Makefile +++ b/windows/Makefile @@ -23,13 +23,13 @@ CLONE := $(GIT) clone -q GITHUB := https://github.com CONFIGURE_ENV := \ + CMAKE_POLICY_VERSION_MINIMUM=3.10 \ PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) \ CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CONFIGURE_ARGS := --prefix="$(BUILD_PREFIX)" CMAKE_ARGS := \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.10 \ -DCMAKE_INSTALL_PREFIX="$(BUILD_PREFIX)" \ -DCMAKE_PREFIX_PATH="$(BUILD_PREFIX)" \ -DCMAKE_C_FLAGS="$(CFLAGS)" \ @@ -283,7 +283,6 @@ $(DOWNLOADS)/fluidsynth/cmakebuild/Makefile: $(DOWNLOADS)/fluidsynth/CMakeLists. $(DOWNLOADS)/fluidsynth/CMakeLists.txt: $(CLONE) $(GITHUB)/mkxp-z/fluidsynth-sans-glib $(DOWNLOADS)/fluidsynth - sed -i 's/"$${CMAKE_COMMAND}" -D/"$${CMAKE_COMMAND}" -DCMAKE_POLICY_VERSION_MINIMUM=3.10 -D/g' $(DOWNLOADS)/fluidsynth/src/CMakeLists.txt # OpenSSL openssl: init_dirs $(LIBDIR)/libssl.a