From ef81a013a5fd5f2e962a9c7f37beea0156711dbc Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 15 Apr 2018 07:41:12 +0530 Subject: cross: Add compiler cross_args after normal args This way they override all other arguments. This matches the order of link arguments too. Note that this means -I flags will come in afterwards and not override anything else, but this is correct since that's how toolchain paths work normally too -- they are searched last. Closes https://github.com/mesonbuild/meson/issues/3089 --- mesonbuild/backend/ninjabackend.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index c941319..41f840d 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1660,9 +1660,9 @@ rule FORTRAN_DEP_HACK if mesonlib.is_windows(): command_template = ' command = {executable} @$out.rsp\n' \ ' rspfile = $out.rsp\n' \ - ' rspfile_content = {cross_args} $ARGS {output_args} {compile_only_args} $in\n' + ' rspfile_content = $ARGS{cross_args} {output_args} {compile_only_args} $in\n' else: - command_template = ' command = {executable} {cross_args} $ARGS {output_args} {compile_only_args} $in\n' + 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)), @@ -1721,10 +1721,10 @@ rule FORTRAN_DEP_HACK if mesonlib.is_windows(): command_template = ''' command = {executable} @$out.rsp rspfile = $out.rsp - rspfile_content = {cross_args} $ARGS {dep_args} {output_args} {compile_only_args} $in + rspfile_content = $ARGS {cross_args} {dep_args} {output_args} {compile_only_args} $in ''' else: - command_template = ' command = {executable} {cross_args} $ARGS {dep_args} {output_args} {compile_only_args} $in\n' + command_template = ' command = {executable} $ARGS {cross_args} {dep_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(cross_args), @@ -1769,7 +1769,7 @@ rule FORTRAN_DEP_HACK output = '' else: output = ' '.join(compiler.get_output_args('$out')) - command = " command = {executable} {cross_args} $ARGS {dep_args} {output_args} {compile_only_args} $in\n".format( + command = " command = {executable} $ARGS {cross_args} {dep_args} {output_args} {compile_only_args} $in\n".format( executable=' '.join(compiler.get_exelist()), cross_args=' '.join(cross_args), dep_args=' '.join(quoted_depargs), -- cgit v1.1