From ee0baa97cd0411e15bd8f47e3874f217887d0a7a Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Mon, 20 Dec 2021 20:33:48 -0500 Subject: modules: use find_program implementation to find programs Do not use ExternalProgram as that is too low-level and doesn't handle e.g. machine file overrides. Fixes #9733 --- mesonbuild/modules/cmake.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mesonbuild/modules/cmake.py') diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index 67fdd0c..fd831e6 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -34,7 +34,6 @@ from ..interpreterbase import ( InvalidArguments, InterpreterException, ) -from ..programs import ExternalProgram COMPATIBILITIES = ['AnyNewerVersion', 'SameMajorVersion', 'SameMinorVersion', 'ExactVersion'] @@ -233,11 +232,11 @@ class CmakeModule(ExtensionModule): return compiler.sizeof('void *', '', env) - def detect_cmake(self): + def detect_cmake(self, state): if self.cmake_detected: return True - cmakebin = ExternalProgram('cmake', silent=False) + cmakebin = state.find_program('cmake', silent=False) if not cmakebin.found(): return False @@ -272,7 +271,7 @@ class CmakeModule(ExtensionModule): if compatibility not in COMPATIBILITIES: raise mesonlib.MesonException('compatibility must be either AnyNewerVersion, SameMajorVersion or ExactVersion.') - if not self.detect_cmake(): + if not self.detect_cmake(state): raise mesonlib.MesonException('Unable to find cmake') pkgroot = pkgroot_name = kwargs.get('install_dir', None) -- cgit v1.1