From 1d5d008510a0796da5cd467db247595d1e45bdbc Mon Sep 17 00:00:00 2001 From: Jaap Aarts Date: Thu, 18 Dec 2025 11:10:11 +0100 Subject: [PATCH 1/3] Set minimum policy --- emcmake.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emcmake.py b/emcmake.py index 9bb05f742042d..9bb1deaea90da 100755 --- a/emcmake.py +++ b/emcmake.py @@ -43,6 +43,8 @@ def has_substr(args, substr): # See https://github.com/emscripten-core/emscripten/issues/15522 args.append(f'-DCMAKE_CROSSCOMPILING_EMULATOR={node_js}') + args.append('-DCMAKE_POLICY_VERSION_MINIMUM=3.5') + # Print a better error if we have no CMake executable on the PATH if not os.path.dirname(args[0]) and not shutil.which(args[0]): print(f'emcmake: cmake executable not found on PATH: `{args[0]}`', file=sys.stderr) From d1b818490c97bd55ce6cd902897ac95574b8f8ad Mon Sep 17 00:00:00 2001 From: Jaap Aarts Date: Thu, 18 Dec 2025 12:32:44 +0100 Subject: [PATCH 2/3] Bump cmake version only for tests --- 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 1f428f70add7a..7a7ce0949fad0 100644 --- a/test/common.py +++ b/test/common.py @@ -1540,7 +1540,7 @@ def build_library(name, # cross compiling. if configure: if configure[0] == 'cmake': - configure = [EMCMAKE] + configure + configure = [EMCMAKE '-DCMAKE_POLICY_VERSION_MINIMUM=3.5'] + configure else: configure = [EMCONFIGURE] + configure else: diff --git a/test/test_other.py b/test/test_other.py index 8071cf2d4f875..6a89af3d62303 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -931,7 +931,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 d73006ed0b26520be0aa809610227536ec6a263d Mon Sep 17 00:00:00 2001 From: Jaap Aarts Date: Thu, 18 Dec 2025 12:33:38 +0100 Subject: [PATCH 3/3] Remove global overwrite --- emcmake.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/emcmake.py b/emcmake.py index 9bb1deaea90da..9bb05f742042d 100755 --- a/emcmake.py +++ b/emcmake.py @@ -43,8 +43,6 @@ def has_substr(args, substr): # See https://github.com/emscripten-core/emscripten/issues/15522 args.append(f'-DCMAKE_CROSSCOMPILING_EMULATOR={node_js}') - args.append('-DCMAKE_POLICY_VERSION_MINIMUM=3.5') - # Print a better error if we have no CMake executable on the PATH if not os.path.dirname(args[0]) and not shutil.which(args[0]): print(f'emcmake: cmake executable not found on PATH: `{args[0]}`', file=sys.stderr)