aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2018-11-29 14:21:07 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-01-06 12:19:29 +0100
commitb91c5aad854bff3a13c27aa1a6ade85ded216207 (patch)
tree134cb258adb2103751e47c0c50ff4c850f3c33d2 /mesonbuild
parentc4eb5c79fe89ca49dd9d9f5bd72be99d919dd2a0 (diff)
downloadmeson-b91c5aad854bff3a13c27aa1a6ade85ded216207.zip
meson-b91c5aad854bff3a13c27aa1a6ade85ded216207.tar.gz
meson-b91c5aad854bff3a13c27aa1a6ade85ded216207.tar.bz2
Update intro dump on meson configure
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mconf.py2
-rw-r--r--mesonbuild/mintro.py20
2 files changed, 20 insertions, 2 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index 28589da..eca32bf 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -14,6 +14,7 @@
import os
from . import (coredata, mesonlib, build)
+from . import mintro
def add_arguments(parser):
coredata.register_builtin_arguments(parser)
@@ -162,6 +163,7 @@ def run(options):
c.print_conf()
if save:
c.save()
+ mintro.update_build_options(c.coredata, builddir)
except ConfException as e:
print('Meson configurator encountered an error:')
raise e
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 326cd6c..04850c6 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -487,8 +487,7 @@ def run(options):
if options.all or options.benchmarks:
toextract += ['benchmarks']
if options.all or options.buildoptions:
- coredata = cdata.load(options.builddir)
- results += [list_buildoptions(coredata)]
+ toextract += ['buildoptions']
if options.all or options.buildsystem_files:
toextract += ['buildsystem_files']
if options.all or options.dependencies:
@@ -550,3 +549,20 @@ def generate_introspection_file(builddata: build.Build, backend: backends.Backen
with open(outfile, 'w') as fp:
json.dump(outdict, fp)
+
+def update_build_options(coredata, builddir):
+ outfile = os.path.join(builddir, INTROSPECTION_OUTPUT_FILE)
+ outfile = os.path.abspath(outfile)
+
+ with open(outfile, 'r') as fp:
+ outdict = json.load(fp)
+
+ intro_info = [
+ list_buildoptions(coredata)
+ ]
+
+ for i in intro_info:
+ outdict[i[0]] = i[1]
+
+ with open(outfile, 'w') as fp:
+ json.dump(outdict, fp)