Skip to content

Commit

Permalink
Fix split of CMAKE_PREFIX_PATH under Windows
Browse files Browse the repository at this point in the history
Under Windows, the colon ':' is used after the drive letter.
So, the colon should not be used as a list separator or for splitting,
otherwise it could lead to paths in CMAKE_PREFIX_PATH with a
semicolon ';' between the drive letter and the rest of the path, e.g:
-DCMAKE_PREFIX_PATH=C;/foo/bar
instead of
-DCMAKE_PREFIX_PATH=C:/foo/bar

Use os.pathsep instead of ':' to split the environmental variable
CMAKE_PREFIX_PATH
  • Loading branch information
c72578 authored and jpakkane committed Nov 2, 2019
1 parent f5c8893 commit bd27769
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesonbuild/dependencies/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,8 @@ def __init__(self, name: str, environment: Environment, kwargs, language=None):

pref_path = self.env.coredata.builtins_per_machine[self.for_machine]['cmake_prefix_path'].value
if 'CMAKE_PREFIX_PATH' in os.environ:
env_pref_path = os.environ['CMAKE_PREFIX_PATH'].split(':')
env_pref_path = [x for x in env_pref_path if x] # Filter out enpty strings
env_pref_path = os.environ['CMAKE_PREFIX_PATH'].split(os.pathsep)
env_pref_path = [x for x in env_pref_path if x] # Filter out empty strings
if not pref_path:
pref_path = []
pref_path += env_pref_path
Expand Down

0 comments on commit bd27769

Please sign in to comment.