aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/backends.py22
-rw-r--r--mesonbuild/backend/ninjabackend.py18
2 files changed, 18 insertions, 22 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 187f302..22920f4 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -343,7 +343,7 @@ 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_exe_wrapper()
+ self.environment.need_exe_wrapper()
if is_cross_built:
exe_wrapper = self.environment.get_exe_wrapper()
if not exe_wrapper.found():
@@ -639,11 +639,11 @@ class Backend:
def get_mingw_extra_paths(self, target):
paths = OrderedSet()
# The cross bindir
- root = self.environment.cross_info.get_root()
+ root = self.environment.properties.host.get_root()
if root:
paths.add(os.path.join(root, 'bin'))
# The toolchain bindir
- sys_root = self.environment.cross_info.get_sys_root()
+ sys_root = self.environment.properties.host.get_sys_root()
if sys_root:
paths.add(os.path.join(sys_root, 'bin'))
# Get program and library dirs from all target compilers
@@ -692,7 +692,7 @@ 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_exe_wrapper()
+ self.environment.need_exe_wrapper()
if isinstance(exe, build.BuildTarget):
is_cross = is_cross and exe.is_cross
if isinstance(exe, dependencies.ExternalProgram):
@@ -763,7 +763,7 @@ class Backend:
def exe_object_to_cmd_array(self, exe):
if self.environment.is_cross_build() and \
isinstance(exe, build.BuildTarget) and exe.is_cross:
- if self.environment.exe_wrapper is None and self.environment.cross_info.need_exe_wrapper():
+ if self.environment.exe_wrapper is None and self.environment.need_exe_wrapper():
s = textwrap.dedent('''
Can not use target {} as a generator because it is cross-built
and no exe wrapper is defined or needs_exe_wrapper is true.
@@ -977,15 +977,13 @@ class Backend:
def create_install_data_files(self):
install_data_file = os.path.join(self.environment.get_scratch_dir(), 'install.dat')
- if self.environment.is_cross_build():
- bins = self.environment.cross_info.config['binaries']
- if 'strip' not in bins:
+ strip_bin = self.environment.binaries.host.lookup_entry('strip')
+ if strip_bin is None:
+ if self.environment.is_cross_build():
mlog.warning('Cross file does not specify strip binary, result will not be stripped.')
- strip_bin = None
else:
- strip_bin = mesonlib.stringlistify(bins['strip'])
- else:
- strip_bin = self.environment.native_strip_bin
+ # TODO go through all candidates, like others
+ strip_bin = [self.environment.default_strip[0]]
d = InstallData(self.environment.get_source_dir(),
self.environment.get_build_dir(),
self.environment.get_prefix(),
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index ee7d203..44bdaab 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -536,7 +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_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()
@@ -1337,7 +1337,7 @@ int dummy;
if not is_cross:
self.generate_java_link(outfile)
if is_cross:
- if self.environment.cross_info.is_cross_build():
+ if self.environment.is_cross_build():
static_linker = self.build.static_cross_linker
else:
static_linker = self.build.static_linker
@@ -1381,6 +1381,8 @@ int dummy;
ctypes = [(self.build.compilers, False)]
if self.environment.is_cross_build():
ctypes.append((self.build.cross_compilers, True))
+ else:
+ ctypes.append((self.build.cross_compilers, True))
for (complist, is_cross) in ctypes:
for langname, compiler in complist.items():
if langname == 'java' \
@@ -1389,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
@@ -1823,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()
@@ -2224,13 +2222,13 @@ rule FORTRAN_DEP_HACK%s
symname = os.path.join(targetdir, target_name + '.symbols')
elem = NinjaBuildElement(self.all_outputs, symname, 'SHSYM', target_file)
if self.environment.is_cross_build():
- elem.add_item('CROSS', '--cross-host=' + self.environment.cross_info.config['host_machine']['system'])
+ 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()