aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorPhillip Cao <ftechz@gmail.com>2018-10-26 15:37:35 +1300
committerPhillip Cao <ftechz@gmail.com>2018-11-08 00:02:23 +1300
commitfc77ec92438b79416299bb81b68f4d27633a5a4e (patch)
treec5bb12ae9422bf8f3cbeb96edc7d8f4530ca5b3f /mesonbuild
parent68c83cb213ab3f17593699020313535d5de1e92f (diff)
downloadmeson-fc77ec92438b79416299bb81b68f4d27633a5a4e.zip
meson-fc77ec92438b79416299bb81b68f4d27633a5a4e.tar.gz
meson-fc77ec92438b79416299bb81b68f4d27633a5a4e.tar.bz2
Get cross_args from the compiler rather than environment directly
This aligns with how the sanity checker gets the args
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/ninjabackend.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 28c6480..9e76c5b 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1537,7 +1537,7 @@ rule FORTRAN_DEP_HACK%s
command_template = ' command = {executable} $ARGS {cross_args} {output_args} {compile_only_args} $in\n'
command = command_template.format(
executable=' '.join([ninja_quote(i) for i in compiler.get_exelist()]),
- cross_args=' '.join(self.get_cross_info_lang_args(compiler.language, is_cross)),
+ cross_args=' '.join(compiler.get_cross_extra_flags(self.environment, False)) if is_cross else '',
output_args=' '.join(compiler.get_output_args('$out')),
compile_only_args=' '.join(compiler.get_compile_only_args())
)
@@ -1548,14 +1548,6 @@ rule FORTRAN_DEP_HACK%s
outfile.write('\n')
self.created_llvm_ir_rule = True
- def get_cross_info_lang_args(self, lang, is_cross):
- if is_cross:
- try:
- return self.environment.cross_info.config['properties'][lang + '_args']
- except KeyError:
- pass
- return []
-
def generate_compile_rule_for(self, langname, compiler, is_cross, outfile):
if langname == 'java':
if not is_cross:
@@ -1589,7 +1581,11 @@ rule FORTRAN_DEP_HACK%s
if d != '$out' and d != '$in':
d = quote_func(d)
quoted_depargs.append(d)
- cross_args = self.get_cross_info_lang_args(langname, is_cross)
+
+ if is_cross:
+ cross_args = compiler.get_cross_extra_flags(self.environment, False)
+ else:
+ cross_args = ''
if compiler.can_linker_accept_rsp():
command_template = ''' command = {executable} @$out.rsp
rspfile = $out.rsp
@@ -1628,7 +1624,7 @@ rule FORTRAN_DEP_HACK%s
cross_args = []
if is_cross:
try:
- cross_args = self.environment.cross_info.config['properties'][langname + '_args']
+ cross_args = compiler.get_cross_extra_flags(self.environment, False)
except KeyError:
pass