aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mconf.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-05-13 10:36:58 -0400
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-06 20:02:37 +0000
commit8fb72510c3b7a7a5f08b4b20b7e1480f5868052a (patch)
treed9131c527142bf6b6b2d28ad55d8f87fc34072eb /mesonbuild/mconf.py
parent3e6dc8fb71cec4e8f32ff4d76c18dcbb892e7221 (diff)
downloadmeson-8fb72510c3b7a7a5f08b4b20b7e1480f5868052a.zip
meson-8fb72510c3b7a7a5f08b4b20b7e1480f5868052a.tar.gz
meson-8fb72510c3b7a7a5f08b4b20b7e1480f5868052a.tar.bz2
Move to coredata some methods handling options
Those methods only use coredata object, so better just move them as a coredata method.
Diffstat (limited to 'mesonbuild/mconf.py')
-rw-r--r--mesonbuild/mconf.py25
1 files changed, 3 insertions, 22 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index abaf0af..0b33ba3 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -42,6 +42,9 @@ class Conf:
def clear_cache(self):
self.coredata.deps = {}
+ def set_options(self, options):
+ self.coredata.set_options(options)
+
def save(self):
# Only called if something has changed so overwrite unconditionally.
coredata.save(self.coredata, self.build_dir)
@@ -94,28 +97,6 @@ class Conf:
else:
print(' {0:{width[0]}} {1:{width[1]}} {3:{width[3]}}'.format(*line, width=col_widths))
- def set_options(self, options):
- for o in options:
- if '=' not in o:
- raise ConfException('Value "%s" not of type "a=b".' % o)
- (k, v) = o.split('=', 1)
- if coredata.is_builtin_option(k):
- self.coredata.set_builtin_option(k, v)
- elif k in self.coredata.backend_options:
- tgt = self.coredata.backend_options[k]
- tgt.set_value(v)
- elif k in self.coredata.user_options:
- tgt = self.coredata.user_options[k]
- tgt.set_value(v)
- elif k in self.coredata.compiler_options:
- tgt = self.coredata.compiler_options[k]
- tgt.set_value(v)
- elif k in self.coredata.base_options:
- tgt = self.coredata.base_options[k]
- tgt.set_value(v)
- else:
- raise ConfException('Unknown option %s.' % k)
-
def print_conf(self):
print('Core properties:')
print(' Source dir', self.build.environment.source_dir)