From ac5ee0c41453b6fcc6bf21d7d714040e622ce6f1 Mon Sep 17 00:00:00 2001 From: Nicolas Schneider Date: Thu, 25 Feb 2016 22:36:39 +0100 Subject: [PATCH] dump coredata to file before calling backend.generate() This ensures that all build files always have a later timestamp than coredata.dat, which is used to check if the build files must be regenerated. --- mesonbuild/environment.py | 2 +- mesonbuild/mesonmain.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 369ca204d..1586248e5 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -126,7 +126,7 @@ class Environment(): def is_cross_build(self): return self.cross_info is not None - def generating_finished(self): + def dump_coredata(self): cdf = os.path.join(self.get_build_dir(), Environment.coredata_file) coredata.save(self.coredata, cdf) diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 1a7b0849d..543a31f99 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -166,8 +166,8 @@ itself as required.''' 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([], {}))) intr.run() + env.dump_coredata() g.generate(intr) - env.generating_finished() dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat') pickle.dump(b, open(dumpfile, 'wb'))