aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/cmake.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-12-20 20:33:48 -0500
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-12-21 12:17:10 +0100
commitee0baa97cd0411e15bd8f47e3874f217887d0a7a (patch)
tree10f998a9c969070edaf3171dd987008022e1a392 /mesonbuild/modules/cmake.py
parent6be258137ebfea474533ab7a855d4a1e817aeedc (diff)
downloadmeson-ee0baa97cd0411e15bd8f47e3874f217887d0a7a.zip
meson-ee0baa97cd0411e15bd8f47e3874f217887d0a7a.tar.gz
meson-ee0baa97cd0411e15bd8f47e3874f217887d0a7a.tar.bz2
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
Diffstat (limited to 'mesonbuild/modules/cmake.py')
-rw-r--r--mesonbuild/modules/cmake.py7
1 files changed, 3 insertions, 4 deletions
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)