aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/msetup.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-10-25 12:19:23 -0400
committerXavier Claessens <xavier.claessens@collabora.com>2018-11-06 16:37:13 -0500
commit43101489cd7b310996badaef19638ec3adbec532 (patch)
tree80571c19bb3ff6c3b7cd42995555b875795cfe65 /mesonbuild/msetup.py
parent11e3011a6bf0adeb51582c590c90b0f4dccb4df8 (diff)
downloadmeson-43101489cd7b310996badaef19638ec3adbec532.zip
meson-43101489cd7b310996badaef19638ec3adbec532.tar.gz
meson-43101489cd7b310996badaef19638ec3adbec532.tar.bz2
Recover when coredata cannot be loaded
Write command line options into a separate file to be able to reconfigure from scatch in the case coredata cannot be loaded. The most common case is when we are reconfiguring with a newer meson version. This means that we should try as much as possible to maintain backward compatibility for the cmd_line.txt file format. The main difference with a normal reconfigure is it will use new default options values and will read again environment variables like CFLAGS, etc.
Diffstat (limited to 'mesonbuild/msetup.py')
-rw-r--r--mesonbuild/msetup.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py
index 4256272..df6ba46 100644
--- a/mesonbuild/msetup.py
+++ b/mesonbuild/msetup.py
@@ -168,6 +168,10 @@ class MesonApp:
build.save(b, dumpfile)
# Post-conf scripts must be run after writing coredata or else introspection fails.
intr.backend.run_postconf_scripts()
+ if env.first_invocation:
+ coredata.write_cmd_line_file(self.build_dir, self.options)
+ else:
+ coredata.update_cmd_line_file(self.build_dir, self.options)
except:
if 'cdf' in locals():
old_cdf = cdf + '.prev'