diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-08-08 12:27:04 -0400 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2019-06-09 13:13:20 -0400 |
commit | 32e827dcdc451e1c5dde952cf08e4b654eac7057 (patch) | |
tree | c6c6377ff8b45e9e50caa8100fc14333342932fa /mesonbuild/environment.py | |
parent | 69005d6b1db5e0bf9cbf5b9c4bb3b5d6a346aadb (diff) | |
download | meson-32e827dcdc451e1c5dde952cf08e4b654eac7057.zip meson-32e827dcdc451e1c5dde952cf08e4b654eac7057.tar.gz meson-32e827dcdc451e1c5dde952cf08e4b654eac7057.tar.bz2 |
Use `env.machines.*` to avoid some `is_cross`
This is a small example of the `is_cross` removal the that abstraction
enables.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index ff4a6b1..f8603f6 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -513,12 +513,11 @@ class Environment: # Various prefixes and suffixes for import libraries, shared libraries, # static libraries, and executables. # Versioning is added to these names in the backends as-needed. - cross = self.is_cross_build() - if mesonlib.for_windows(cross, self): + if mesonlib.for_windows(self): self.exe_suffix = 'exe' self.object_suffix = 'obj' self.win_libdir_layout = True - elif mesonlib.for_cygwin(cross, self): + elif mesonlib.for_cygwin(self): self.exe_suffix = 'exe' self.object_suffix = 'o' self.win_libdir_layout = True @@ -774,9 +773,9 @@ class Environment: cls = ClangClCCompiler if lang == 'c' else ClangClCPPCompiler return cls(compiler, version, is_cross, exe_wrap, target) if 'clang' in out: - if 'Apple' in out or mesonlib.for_darwin(want_cross, self): + if 'Apple' in out or mesonlib.for_darwin(self): compiler_type = CompilerType.CLANG_OSX - elif 'windows' in out or mesonlib.for_windows(want_cross, self): + elif 'windows' in out or mesonlib.for_windows(self): compiler_type = CompilerType.CLANG_MINGW else: compiler_type = CompilerType.CLANG_STANDARD @@ -808,16 +807,16 @@ class Environment: return cls(compiler, version, is_cross, exe_wrap, target) if 'PGI Compilers' in out: - if mesonlib.for_darwin(want_cross, self): + if self.machines[for_machine].is_darwin(): compiler_type = CompilerType.PGI_OSX - elif mesonlib.for_windows(want_cross, self): + elif self.machines[for_machine].is_windows(): compiler_type = CompilerType.PGI_WIN else: compiler_type = CompilerType.PGI_STANDARD cls = PGICCompiler if lang == 'c' else PGICPPCompiler return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap) if '(ICC)' in out: - if mesonlib.for_darwin(want_cross, self): + if self.machine[for_macine].is_darwin(): compiler_type = CompilerType.ICC_OSX elif mesonlib.for_windows(want_cross, self): # TODO: fix ICC on Windows @@ -932,9 +931,9 @@ class Environment: return PathScaleFortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version) if 'PGI Compilers' in out: - if mesonlib.for_darwin(want_cross, self): + if self.machine[for_macine].is_darwin(): compiler_type = CompilerType.PGI_OSX - elif mesonlib.for_windows(want_cross, self): + elif self.machines[for_machine].is_windows(): compiler_type = CompilerType.PGI_WIN else: compiler_type = CompilerType.PGI_STANDARD |