aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/msetup.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-09-01 11:01:01 -0400
committerXavier Claessens <xclaesse@gmail.com>2021-09-02 19:38:29 -0400
commit5e55a0bb2b95546da41fd27dbccc8c056815f391 (patch)
tree6d48d931ee300630fa987b7e74654194b86d71ab /mesonbuild/msetup.py
parenta616a23713dd34638adee29413603b2eeb80456b (diff)
downloadmeson-5e55a0bb2b95546da41fd27dbccc8c056815f391.zip
meson-5e55a0bb2b95546da41fd27dbccc8c056815f391.tar.gz
meson-5e55a0bb2b95546da41fd27dbccc8c056815f391.tar.bz2
interpreter: Add summary of all user defined options
It is a commonly needed information to help debugging build issues. We already were printing options with non-default value at the end of the configure but outside of the summary. Keeping the list of user defined options in the interpreter will also in the future be useful to use new default value on reconfigure.
Diffstat (limited to 'mesonbuild/msetup.py')
-rw-r--r--mesonbuild/msetup.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py
index 9ed2981..27d2fd4 100644
--- a/mesonbuild/msetup.py
+++ b/mesonbuild/msetup.py
@@ -28,7 +28,6 @@ from . import environment, interpreter, mesonlib
from . import build
from . import mlog, coredata
from . import mintro
-from .mconf import make_lower_case
from .mesonlib import MesonException
git_ignore_file = '''# This file is autogenerated by Meson. If you change or delete it, it won't be recreated.
@@ -184,9 +183,14 @@ class MesonApp:
self._generate(env)
def _generate(self, env: environment.Environment) -> None:
+ # Get all user defined options, including options that have been defined
+ # during a previous invocation or using meson configure.
+ user_defined_options = argparse.Namespace(**vars(self.options))
+ coredata.read_cmd_line_file(self.build_dir, user_defined_options)
+
mlog.debug('Build started at', datetime.datetime.now().isoformat())
mlog.debug('Main binary:', sys.executable)
- mlog.debug('Build Options:', coredata.get_cmd_line_options(self.build_dir, self.options))
+ mlog.debug('Build Options:', coredata.format_cmd_line_options(user_defined_options))
mlog.debug('Python system:', platform.system())
mlog.log(mlog.bold('The Meson build system'))
mlog.log('Version:', coredata.version)
@@ -198,7 +202,7 @@ class MesonApp:
mlog.log('Build type:', mlog.bold('native build'))
b = build.Build(env)
- intr = interpreter.Interpreter(b)
+ intr = interpreter.Interpreter(b, user_defined_options=user_defined_options)
if env.is_cross_build():
logger_fun = mlog.log
else:
@@ -224,11 +228,6 @@ class MesonApp:
except Exception as e:
mintro.write_meson_info_file(b, [e])
raise
- # Print all default option values that don't match the current value
- for def_opt_name, def_opt_value, cur_opt_value in intr.get_non_matching_default_options():
- mlog.log('Option', mlog.bold(def_opt_name), 'is:',
- mlog.bold('{}'.format(make_lower_case(cur_opt_value.printable_value()))),
- '[default: {}]'.format(make_lower_case(def_opt_value)))
try:
dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
# We would like to write coredata as late as possible since we use the existence of