diff --git a/backends.py b/backends.py index 5049be488..3595f2034 100644 --- a/backends.py +++ b/backends.py @@ -861,6 +861,9 @@ class NinjaBackend(Backend): deps = [os.path.join(self.build_to_src, df) \ for df in self.interpreter.get_build_def_files()] + if self.environment.is_cross_build(): + deps.append(os.path.join(self.build_to_src, + self.environment.coredata.cross_file)) elem = NinjaBuildElement('build.ninja', 'REGENERATE_BUILD', deps) elem.write(outfile) diff --git a/coredata.py b/coredata.py index 94a1cda8d..58c63d077 100644 --- a/coredata.py +++ b/coredata.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pickle +import pickle, os version = '0.7.0-research' @@ -34,7 +34,10 @@ class CoreData(): self.buildtype = options.buildtype self.strip = options.strip self.coverage = options.coverage - self.cross_file = options.cross_file + if options.cross_file is not None: + self.cross_file = os.path.join(os.getcwd(), options.cross_file) + else: + self.cross_file = None self.compilers = {} self.deps = {} diff --git a/environment.py b/environment.py index 6f8f644e0..af4e9d9fc 100644 --- a/environment.py +++ b/environment.py @@ -695,7 +695,7 @@ class Environment(): try: cdf = os.path.join(self.get_build_dir(), Environment.coredata_file) self.coredata = coredata.load(cdf) - except IOError: + except FileNotFoundError: self.coredata = coredata.CoreData(options) if self.coredata.cross_file: self.cross_info = CrossBuildInfo(self.coredata.cross_file)