aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r--mesonbuild/dependencies/base.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index d11aebf..258a4fb 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -1699,12 +1699,19 @@ class ExternalProgram:
for_machine = MachineChoice.BUILD
def __init__(self, name: str, command: Optional[List[str]] = None,
- silent: bool = False, search_dir: Optional[str] = None):
+ silent: bool = False, search_dir: Optional[str] = None,
+ extra_search_dirs: Optional[List[str]] = None):
self.name = name
if command is not None:
self.command = listify(command)
else:
- self.command = self._search(name, search_dir)
+ all_search_dirs = [search_dir]
+ if extra_search_dirs:
+ all_search_dirs += extra_search_dirs
+ for d in all_search_dirs:
+ self.command = self._search(name, d)
+ if self.found():
+ break
# Set path to be the last item that is actually a file (in order to
# skip options in something like ['python', '-u', 'file.py']. If we