2018-03-05 06:57:38 +01:00
|
|
|
--- a/mesonbuild/coredata.py
|
|
|
|
+++ b/mesonbuild/coredata.py
|
2018-03-06 03:29:07 +01:00
|
|
|
@@ -282,18 +282,13 @@
|
2018-03-05 06:57:38 +01:00
|
|
|
'''
|
|
|
|
if option.endswith('dir') and os.path.isabs(value) and \
|
|
|
|
option not in builtin_dir_noprefix_options:
|
|
|
|
- # Value must be a subdir of the prefix
|
|
|
|
# commonpath will always return a path in the native format, so we
|
|
|
|
# must use pathlib.PurePath to do the same conversion before
|
|
|
|
# comparing.
|
2018-03-06 03:29:07 +01:00
|
|
|
- if os.path.commonpath([value, prefix]) != str(PurePath(prefix)):
|
2018-03-05 06:57:38 +01:00
|
|
|
- m = 'The value of the {!r} option is {!r} which must be a ' \
|
|
|
|
- 'subdir of the prefix {!r}.\nNote that if you pass a ' \
|
|
|
|
- 'relative path, it is assumed to be a subdir of prefix.'
|
|
|
|
- raise MesonException(m.format(option, value, prefix))
|
|
|
|
- # Convert path to be relative to prefix
|
|
|
|
- skip = len(prefix) + 1
|
|
|
|
- value = value[skip:]
|
2018-03-06 03:29:07 +01:00
|
|
|
+ if os.path.commonpath([value, prefix]) == str(PurePath(prefix)):
|
2018-03-05 06:57:38 +01:00
|
|
|
+ # Convert path to be relative to prefix
|
|
|
|
+ skip = len(prefix) + 1
|
|
|
|
+ value = value[skip:]
|
|
|
|
return value
|
|
|
|
|
|
|
|
def init_builtins(self, options):
|