diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-07-26 23:50:04 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-07-27 00:55:28 +0300 |
commit | 30d0c2292fee831d74f080e62c1c74990ea76abb (patch) | |
tree | 7f704fc6be20119e95ccf083066d00f619993bc0 /environment.py | |
parent | 37b2a195bd24d71044474129cdf4af3540770618 (diff) | |
download | meson-30d0c2292fee831d74f080e62c1c74990ea76abb.zip meson-30d0c2292fee831d74f080e62c1c74990ea76abb.tar.gz meson-30d0c2292fee831d74f080e62c1c74990ea76abb.tar.bz2 |
Support target-only cross compilation properly.
Diffstat (limited to 'environment.py')
-rw-r--r-- | environment.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/environment.py b/environment.py index 82c909e..c594776 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 |