diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-06-12 12:15:14 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-06-13 11:05:28 +0000 |
commit | edcddb3a28b11a32ffc19857ceca2f5384381fd9 (patch) | |
tree | 1bf1c67a22005e575f78d59de8bee3472236b06d /mesonbuild | |
parent | ec1bd22b15a5bfbd4599ebf30e8c63067f336f29 (diff) | |
download | meson-edcddb3a28b11a32ffc19857ceca2f5384381fd9.zip meson-edcddb3a28b11a32ffc19857ceca2f5384381fd9.tar.gz meson-edcddb3a28b11a32ffc19857ceca2f5384381fd9.tar.bz2 |
cmake: Fix handling of path seperators (fixes #7294)
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/cmake/executor.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies/base.py | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py index d64286a..148a999 100644 --- a/mesonbuild/cmake/executor.py +++ b/mesonbuild/cmake/executor.py @@ -69,7 +69,7 @@ class CMakeExecutor: self.environment.is_cross_build(), 'CMAKE_PREFIX_PATH') if env_pref_path is not None: - env_pref_path = env_pref_path.split(os.pathsep) + env_pref_path = re.split(r':|;', env_pref_path) env_pref_path = [x for x in env_pref_path if x] # Filter out empty strings if not self.prefix_paths: self.prefix_paths = [] diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 0f8c8a2..eed714a 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -1145,12 +1145,17 @@ class CMakeDependency(ExternalDependency): except MesonException: return None + def process_paths(l: T.List[str]) -> T.Set[str]: + l = [x.split(':') for x in l] + l = [x for sublist in l for x in sublist] + return set(l) + # Extract the variables and sanity check them - root_paths = set(temp_parser.get_cmake_var('MESON_FIND_ROOT_PATH')) - root_paths.update(set(temp_parser.get_cmake_var('MESON_CMAKE_SYSROOT'))) + root_paths = process_paths(temp_parser.get_cmake_var('MESON_FIND_ROOT_PATH')) + root_paths.update(process_paths(temp_parser.get_cmake_var('MESON_CMAKE_SYSROOT'))) root_paths = sorted(root_paths) root_paths = list(filter(lambda x: os.path.isdir(x), root_paths)) - module_paths = set(temp_parser.get_cmake_var('MESON_PATHS_LIST')) + module_paths = process_paths(temp_parser.get_cmake_var('MESON_PATHS_LIST')) rooted_paths = [] for j in [Path(x) for x in root_paths]: for i in [Path(x) for x in module_paths]: |