diff options
-rw-r--r-- | mesonbuild/backend/backends.py | 2 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 18 | ||||
-rw-r--r-- | mesonbuild/environment.py | 5 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 2 |
4 files changed, 4 insertions, 23 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index e8adc99..187f302 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -343,7 +343,6 @@ class Backend: exe_is_native = True is_cross_built = (not exe_is_native) and \ self.environment.is_cross_build() and \ - self.environment.cross_info.need_cross_compiler() and \ self.environment.cross_info.need_exe_wrapper() if is_cross_built: exe_wrapper = self.environment.get_exe_wrapper() @@ -693,7 +692,6 @@ class Backend: else: cmd = [os.path.join(self.environment.get_build_dir(), self.get_target_filename(t.get_exe()))] is_cross = self.environment.is_cross_build() and \ - self.environment.cross_info.need_cross_compiler() and \ self.environment.cross_info.need_exe_wrapper() if isinstance(exe, build.BuildTarget): is_cross = is_cross and exe.is_cross diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 372d7c2..ee7d203 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -536,7 +536,6 @@ int dummy; # a serialized executable wrapper for that and check if the # CustomTarget command needs extra paths first. is_cross = self.environment.is_cross_build() and \ - self.environment.cross_info.need_cross_compiler() and \ self.environment.cross_info.need_exe_wrapper() if mesonlib.for_windows(is_cross, self.environment) or \ mesonlib.for_cygwin(is_cross, self.environment): @@ -1338,7 +1337,7 @@ int dummy; if not is_cross: self.generate_java_link(outfile) if is_cross: - if self.environment.cross_info.need_cross_compiler(): + if self.environment.cross_info.is_cross_build(): static_linker = self.build.static_cross_linker else: static_linker = self.build.static_linker @@ -1381,12 +1380,6 @@ int dummy; num_pools = self.environment.coredata.backend_options['backend_max_links'].value ctypes = [(self.build.compilers, False)] if self.environment.is_cross_build(): - if self.environment.cross_info.need_cross_compiler(): - ctypes.append((self.build.cross_compilers, True)) - else: - # Native compiler masquerades as the cross compiler. - ctypes.append((self.build.compilers, True)) - else: ctypes.append((self.build.cross_compilers, True)) for (complist, is_cross) in ctypes: for langname, compiler in complist.items(): @@ -1667,12 +1660,7 @@ rule FORTRAN_DEP_HACK%s self.generate_compile_rule_for(langname, compiler, False, outfile) self.generate_pch_rule_for(langname, compiler, False, outfile) if self.environment.is_cross_build(): - # In case we are going a target-only build, make the native compilers - # masquerade as cross compilers. - if self.environment.cross_info.need_cross_compiler(): - cclist = self.build.cross_compilers - else: - cclist = self.build.compilers + cclist = self.build.cross_compilers for langname, compiler in cclist.items(): if compiler.get_id() == 'clang': self.generate_llvm_ir_compile_rule(compiler, True, outfile) @@ -2235,7 +2223,7 @@ rule FORTRAN_DEP_HACK%s targetdir = self.get_target_private_dir(target) symname = os.path.join(targetdir, target_name + '.symbols') elem = NinjaBuildElement(self.all_outputs, symname, 'SHSYM', target_file) - if self.environment.is_cross_build() and self.environment.cross_info.need_cross_compiler(): + if self.environment.is_cross_build(): elem.add_item('CROSS', '--cross-host=' + self.environment.cross_info.config['host_machine']['system']) elem.write(outfile) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 71f75f9..f1145e5 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -1215,11 +1215,6 @@ class CrossBuildInfo: def get_sys_root(self): return self.get_properties().get('sys_root', None) - # When 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 - def need_exe_wrapper(self): value = self.config['properties'].get('needs_exe_wrapper', None) if value is not None: diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 61481a4..50f6a42 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2685,7 +2685,7 @@ external dependencies (including libraries) must go to "dependencies".''') def add_languages(self, args, required): success = True - need_cross_compiler = self.environment.is_cross_build() and self.environment.cross_info.need_cross_compiler() + need_cross_compiler = self.environment.is_cross_build() for lang in sorted(args, key=compilers.sort_clink): lang = lang.lower() if lang in self.coredata.compilers: |