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.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index e359219..9ddf6db 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -1186,7 +1186,12 @@ class CMakeDependency(ExternalDependency):
return None
def process_paths(l: T.List[str]) -> T.Set[str]:
- l = [x.split(':') for x in l]
+ if mesonlib.is_windows():
+ # Cannot split on ':' on Windows because its in the drive letter
+ l = [x.split(os.pathsep) for x in l]
+ else:
+ # https://github.com/mesonbuild/meson/issues/7294
+ l = [re.split(r':|;', x) for x in l]
l = [x for sublist in l for x in sublist]
return set(l)
@@ -1290,8 +1295,17 @@ class CMakeDependency(ExternalDependency):
if search_lib_dirs(i):
return True
+ # Check PATH
+ system_env = [] # type: T.List[str]
+ for i in os.environ.get('PATH', '').split(os.pathsep):
+ if i.endswith('/bin') or i.endswith('\\bin'):
+ i = i[:-4]
+ if i.endswith('/sbin') or i.endswith('\\sbin'):
+ i = i[:-5]
+ system_env += [i]
+
# Check the system paths
- for i in self.cmakeinfo['module_paths']:
+ for i in self.cmakeinfo['module_paths'] + system_env:
if find_module(i):
return True