aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py32
1 files changed, 9 insertions, 23 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 372d7c2..44bdaab 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -536,8 +536,7 @@ 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()
+ self.environment.need_exe_wrapper()
if mesonlib.for_windows(is_cross, self.environment) or \
mesonlib.for_cygwin(is_cross, self.environment):
extra_bdeps = target.get_transitive_build_target_deps()
@@ -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.is_cross_build():
static_linker = self.build.static_cross_linker
else:
static_linker = self.build.static_linker
@@ -1381,11 +1380,7 @@ 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))
+ ctypes.append((self.build.cross_compilers, True))
else:
ctypes.append((self.build.cross_compilers, True))
for (complist, is_cross) in ctypes:
@@ -1396,13 +1391,9 @@ int dummy;
or langname == 'cs':
continue
crstr = ''
- cross_args = []
+ cross_args = self.environment.properties.host.get_external_link_args(langname)
if is_cross:
crstr = '_CROSS'
- try:
- cross_args = self.environment.cross_info.config['properties'][langname + '_link_args']
- except KeyError:
- pass
rule = 'rule %s%s_LINKER\n' % (langname, crstr)
if compiler.can_linker_accept_rsp():
command_template = ''' command = {executable} @$out.rsp
@@ -1667,12 +1658,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)
@@ -1835,7 +1821,7 @@ rule FORTRAN_DEP_HACK%s
def get_cross_stdlib_args(self, target, compiler):
if not target.is_cross:
return []
- if not self.environment.cross_info.has_stdlib(compiler.language):
+ if not self.environment.properties.host.has_stdlib(compiler.language):
return []
return compiler.get_no_stdinc_args()
@@ -2235,14 +2221,14 @@ 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():
- elem.add_item('CROSS', '--cross-host=' + self.environment.cross_info.config['host_machine']['system'])
+ if self.environment.is_cross_build():
+ elem.add_item('CROSS', '--cross-host=' + self.environment.machines.host.system)
elem.write(outfile)
def get_cross_stdlib_link_args(self, target, linker):
if isinstance(target, build.StaticLibrary) or not target.is_cross:
return []
- if not self.environment.cross_info.has_stdlib(linker.language):
+ if not self.environment.properties.host.has_stdlib(linker.language):
return []
return linker.get_no_stdlib_link_args()