|
|
@ -61,8 +61,10 @@ class UserStringOption(UserOption): |
|
|
|
def validate(self, value): |
|
|
|
def validate(self, value): |
|
|
|
if not isinstance(value, str): |
|
|
|
if not isinstance(value, str): |
|
|
|
raise MesonException('Value "%s" for string option "%s" is not a string.' % (str(newvalue), self.name)) |
|
|
|
raise MesonException('Value "%s" for string option "%s" is not a string.' % (str(newvalue), self.name)) |
|
|
|
if self.name == 'prefix' and not os.path.isabs(value): |
|
|
|
if self.name == 'prefix': |
|
|
|
raise MesonException('Prefix option value \'{0}\' must be an absolute path.'.format(value)) |
|
|
|
if not os.path.isabs(value): |
|
|
|
|
|
|
|
if len(value) >= 2 and value[1] != ':': |
|
|
|
|
|
|
|
raise MesonException('Prefix option value \'{0}\' must be an absolute path.'.format(value)) |
|
|
|
if self.name in ('libdir', 'bindir', 'includedir', 'datadir', 'mandir', 'localedir') \ |
|
|
|
if self.name in ('libdir', 'bindir', 'includedir', 'datadir', 'mandir', 'localedir') \ |
|
|
|
and os.path.isabs(value): |
|
|
|
and os.path.isabs(value): |
|
|
|
raise MesonException('Option %s must not be an absolute path.' % self.name) |
|
|
|
raise MesonException('Option %s must not be an absolute path.' % self.name) |
|
|
|