···1--- a/mesonbuild/coredata.py
2+++ b/mesonbuild/coredata.py
3-@@ -266,18 +266,13 @@
4 '''
5 if option.endswith('dir') and os.path.isabs(value) and \
6 option not in builtin_dir_noprefix_options:
···8 # commonpath will always return a path in the native format, so we
9 # must use pathlib.PurePath to do the same conversion before
10 # comparing.
11-- if commonpath([value, prefix]) != str(PurePath(prefix)):
12- m = 'The value of the {!r} option is {!r} which must be a ' \
13- 'subdir of the prefix {!r}.\nNote that if you pass a ' \
14- 'relative path, it is assumed to be a subdir of prefix.'
···16- # Convert path to be relative to prefix
17- skip = len(prefix) + 1
18- value = value[skip:]
19-+ if commonpath([value, prefix]) == str(PurePath(prefix)):
20+ # Convert path to be relative to prefix
21+ skip = len(prefix) + 1
22+ value = value[skip:]
···1--- a/mesonbuild/coredata.py
2+++ b/mesonbuild/coredata.py
3+@@ -282,18 +282,13 @@
4 '''
5 if option.endswith('dir') and os.path.isabs(value) and \
6 option not in builtin_dir_noprefix_options:
···8 # commonpath will always return a path in the native format, so we
9 # must use pathlib.PurePath to do the same conversion before
10 # comparing.
11+- if os.path.commonpath([value, prefix]) != str(PurePath(prefix)):
12- m = 'The value of the {!r} option is {!r} which must be a ' \
13- 'subdir of the prefix {!r}.\nNote that if you pass a ' \
14- 'relative path, it is assumed to be a subdir of prefix.'
···16- # Convert path to be relative to prefix
17- skip = len(prefix) + 1
18- value = value[skip:]
19++ if os.path.commonpath([value, prefix]) == str(PurePath(prefix)):
20+ # Convert path to be relative to prefix
21+ skip = len(prefix) + 1
22+ value = value[skip:]