From c3071933663c845cfb7aab7a3684ed2c295123a8 Mon Sep 17 00:00:00 2001 From: Jaap Aarts Date: Thu, 18 Dec 2025 11:10:11 +0100 Subject: [PATCH 1/2] Set minimum policy Co-authored-by: Kleis Auke Wolthuizen --- test/common.py | 2 +- test/test_other.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/common.py b/test/common.py index 613d0fcff75a3..82d1cf83169eb 100644 --- a/test/common.py +++ b/test/common.py @@ -1571,7 +1571,7 @@ def build_library(self, name, build_dir, generated_libs, configure, make, make_a # cross compiling. if configure: if configure[0] == 'cmake': - configure = [EMCMAKE] + configure + configure = [EMCMAKE] + configure + ['-DCMAKE_POLICY_VERSION_MINIMUM=3.5'] else: configure = [EMCONFIGURE] + configure else: diff --git a/test/test_other.py b/test/test_other.py index 46637386f834b..725e7042d34a0 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -945,7 +945,7 @@ def test_cmake(self, test_dir, output_file, cmake_args): os.mkdir(builddir) with common.chdir(builddir): # Run Cmake - cmd = [EMCMAKE, 'cmake'] + cmake_args + ['-G', generator, cmakelistsdir] + cmd = [EMCMAKE, 'cmake'] + cmake_args + ['-G', generator, cmakelistsdir, '-DCMAKE_POLICY_VERSION_MINIMUM=3.5'] env = os.environ.copy() # https://github.com/emscripten-core/emscripten/pull/5145: Check that CMake works even if EMCC_SKIP_SANITY_CHECK=1 is passed. From 304ae62d09ac381c8492189cc692f1fee55e93f8 Mon Sep 17 00:00:00 2001 From: Jaap Aarts Date: Tue, 17 Feb 2026 21:31:43 +0100 Subject: [PATCH 2/2] Add comments about the minimum cmake version --- test/common.py | 2 ++ test/test_other.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/test/common.py b/test/common.py index 82d1cf83169eb..6e9cbc94b3ef7 100644 --- a/test/common.py +++ b/test/common.py @@ -1571,6 +1571,8 @@ def build_library(self, name, build_dir, generated_libs, configure, make, make_a # cross compiling. if configure: if configure[0] == 'cmake': + # Some tests have very old cmake_minimum_version settings which is not supported by cmake 4+. + # Forcing a slighly more recent cmake_minimum_version works around this issue. configure = [EMCMAKE] + configure + ['-DCMAKE_POLICY_VERSION_MINIMUM=3.5'] else: configure = [EMCONFIGURE] + configure diff --git a/test/test_other.py b/test/test_other.py index 725e7042d34a0..843daed807e40 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -945,6 +945,9 @@ def test_cmake(self, test_dir, output_file, cmake_args): os.mkdir(builddir) with common.chdir(builddir): # Run Cmake + + # Some tests have very old cmake_minimum_version settings which is not supported by cmake 4+. + # Forcing a slighly more recent cmake_minimum_version works around this issue. cmd = [EMCMAKE, 'cmake'] + cmake_args + ['-G', generator, cmakelistsdir, '-DCMAKE_POLICY_VERSION_MINIMUM=3.5'] env = os.environ.copy()