aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/optinterpreter.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-03-24 21:25:26 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-04-04 23:41:23 +0530
commit8ee9365717d544c5e51ccd3daf44f0c39b818057 (patch)
tree022b0adc8507e995cb19f49d991689d0e199ca0d /mesonbuild/optinterpreter.py
parent6042e21e25e31d4bb794ab83237beac511a15837 (diff)
downloadmeson-8ee9365717d544c5e51ccd3daf44f0c39b818057.zip
meson-8ee9365717d544c5e51ccd3daf44f0c39b818057.tar.gz
meson-8ee9365717d544c5e51ccd3daf44f0c39b818057.tar.bz2
Allow option values to contain ':'
Instead, check that option keys don't contain ':'. Also change the failing option test to look for this. Closes https://github.com/mesonbuild/meson/issues/1454
Diffstat (limited to 'mesonbuild/optinterpreter.py')
-rw-r--r--mesonbuild/optinterpreter.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py
index 10b8fab..f9e7f26 100644
--- a/mesonbuild/optinterpreter.py
+++ b/mesonbuild/optinterpreter.py
@@ -75,15 +75,16 @@ class OptionInterpreter:
self.cmd_line_options = {}
for o in command_line_options:
if self.subproject != '': # Strip the beginning.
+ # Ignore options that aren't for this subproject
if not o.startswith(self.sbprefix):
continue
- else:
- if ':' in o:
- continue
try:
(key, value) = o.split('=', 1)
except ValueError:
raise OptionException('Option {!r} must have a value separated by equals sign.'.format(o))
+ # Ignore subproject options if not fetching subproject options
+ if self.subproject == '' and ':' in key:
+ continue
self.cmd_line_options[key] = value
def process(self, option_file):