aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/msetup.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-01-07 23:10:22 +0200
committerGitHub <noreply@github.com>2019-01-07 23:10:22 +0200
commit3bf2ca483e9ca80ee81ee0a07d5f5c9f36817bb3 (patch)
tree147fac32390c09473b9aa64d3990cbbe187160bd /mesonbuild/msetup.py
parentd085002d18f64e7ba91449f8b726a00b8e728a0a (diff)
parentb82cbbdd4c6470643c383d53bd7360342e61e233 (diff)
downloadmeson-3bf2ca483e9ca80ee81ee0a07d5f5c9f36817bb3.zip
meson-3bf2ca483e9ca80ee81ee0a07d5f5c9f36817bb3.tar.gz
meson-3bf2ca483e9ca80ee81ee0a07d5f5c9f36817bb3.tar.bz2
Merge pull request #4732 from mensinda/introMesonInfo2
mintro: Added `meson-info.json` introspection information about the latest meson run
Diffstat (limited to 'mesonbuild/msetup.py')
-rw-r--r--mesonbuild/msetup.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py
index 67559a1..023afdb 100644
--- a/mesonbuild/msetup.py
+++ b/mesonbuild/msetup.py
@@ -185,11 +185,15 @@ class MesonApp:
mlog.log('Target machine cpu:', mlog.bold(intr.builtin['target_machine'].cpu_method([], {})))
mlog.log('Build machine cpu family:', mlog.bold(intr.builtin['build_machine'].cpu_family_method([], {})))
mlog.log('Build machine cpu:', mlog.bold(intr.builtin['build_machine'].cpu_method([], {})))
- if self.options.profile:
- fname = os.path.join(self.build_dir, 'meson-private', 'profile-interpreter.log')
- profile.runctx('intr.run()', globals(), locals(), filename=fname)
- else:
- intr.run()
+ try:
+ if self.options.profile:
+ fname = os.path.join(self.build_dir, 'meson-private', 'profile-interpreter.log')
+ profile.runctx('intr.run()', globals(), locals(), filename=fname)
+ else:
+ intr.run()
+ 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:',
@@ -224,7 +228,9 @@ class MesonApp:
profile.runctx('mintro.generate_introspection_file(b, intr.backend)', globals(), locals(), filename=fname)
else:
mintro.generate_introspection_file(b, intr.backend)
- except:
+ mintro.write_meson_info_file(b, [], True)
+ except Exception as e:
+ mintro.write_meson_info_file(b, [e])
if 'cdf' in locals():
old_cdf = cdf + '.prev'
if os.path.exists(old_cdf):