ninja: Don't use @file.rsp with ArLinker on Windows

We can't use @file.rsp on Windows with ArLinker because llvm-ar and
gcc-ar blindly pass the --plugin argument to `ar` and you cannot pass
options as arguments while using the @file.rsp syntax.

[5/7] cc @mylib@sta/libfile4.c.obj.rsp
[6/7] gcc-ar @libmylib.a.rsp
FAILED: libmylib.a
gcc-ar @libmylib.a.rsp
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ar.exe: invalid option -- @

https://github.com/mesonbuild/meson/pull/1649
https://ci.appveyor.com/project/jpakkane/meson/build/1.0.2330/job/w3hj9jfdasefsqi9
pull/1649/head
Nirbheek Chauhan 8 years ago
parent bf2af8b7f1
commit 61ed2702bf
  1. 6
      mesonbuild/backend/ninjabackend.py

@ -1304,7 +1304,11 @@ int dummy;
if static_linker is None:
return
rule = 'rule STATIC%s_LINKER\n' % crstr
if mesonlib.is_windows():
# We don't use @file.rsp on Windows with ArLinker because llvm-ar and
# gcc-ar blindly pass the --plugin argument to `ar` and you cannot pass
# options as arguments while using the @file.rsp syntax.
# See: https://github.com/mesonbuild/meson/issues/1646
if mesonlib.is_windows() and not isinstance(static_linker, compilers.ArLinker):
command_template = ''' command = {executable} @$out.rsp
rspfile = $out.rsp
rspfile_content = $LINK_ARGS {output_args} $in

Loading…
Cancel
Save