From fab04b1fbe06188cb2df00f66cf7a74d00686f98 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 6 Feb 2017 15:17:17 +0100 Subject: [PATCH] Change the order of link_args when cross_compiling with ninja. A user may want to add libraries to link with in the (c|cpp)_link_args property of the cross-compile file. Those libraries should be at the end of the command line due to reference resolution mechanism of the compiler. By moving the cross_args after LINK_ARGS we are sure that specific cross-compilation libraries are at the end of the command line. See [github PR #1363](https://github.com/mesonbuild/meson/pull/1363) to have the context of this change. --- mesonbuild/backend/ninjabackend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 67a44a3d9..a22e0aba2 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1276,10 +1276,10 @@ int dummy; if mesonlib.is_windows(): command_template = ''' command = {executable} @$out.rsp rspfile = $out.rsp - rspfile_content = {cross_args} $ARGS {output_args} $in $LINK_ARGS $aliasing + rspfile_content = $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing ''' else: - command_template = ' command = {executable} {cross_args} $ARGS {output_args} $in $LINK_ARGS $aliasing\n' + command_template = ' command = {executable} $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing\n' command = command_template.format( executable=' '.join(compiler.get_linker_exelist()), cross_args=' '.join(cross_args),