From 30d0c2292fee831d74f080e62c1c74990ea76abb Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 26 Jul 2015 23:50:04 +0300 Subject: Support target-only cross compilation properly. --- environment.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'environment.py') diff --git a/environment.py b/environment.py index 82c909e55..c59477684 100644 --- a/environment.py +++ b/environment.py @@ -590,10 +590,14 @@ class CrossBuildInfo(): def __init__(self, filename): self.config = {} self.parse_datafile(filename) + if 'target_machine' in self.config: + return + if not 'host_machine' in self.config: + raise coredata.MesonException('Cross info file must have either host or a target machine.') if not 'properties' in self.config: - raise EnvironmentError('Cross file is missing "properties".') + raise coredata.MesonException('Cross file is missing "properties".') if not 'binaries' in self.config: - raise EnvironmentError('Cross file is missing "binaries".') + raise coredata.MesonException('Cross file is missing "binaries".') def ok_type(self, i): return isinstance(i, str) or isinstance(i, int) or isinstance(i, bool) @@ -627,3 +631,8 @@ class CrossBuildInfo(): def has_target(self): return 'target_machine' in self.config + + # Wehn compiling a cross compiler we use the native compiler for everything. + # But not when cross compiling a cross compiler. + def need_cross_compiler(self): + return 'host_machine' in self.config -- cgit v1.2.3