Ninja: Wrong usage of response files with OpenWatcom
Using OpenWatcom 2.0, and the Ninja generator, targeting e.g. OS/2
When linking a dll, the following command is emitted:
C:\watcom\binnt\wlink.exe option quiet name SDL2.dll opt map system os2v2_dll option implib=SDL2.lib file {@CMakeFiles\SDL2.rsp}
which fails with the following error:
Error! E2008: cannot open library.obj : No such file or directory
Error! E2008: cannot open libconv.lib : No such file or directory
Error! E2008: cannot open library.obj : No such file or directory
Error! E2008: cannot open mmpm2.lib : No such file or directory
The response file should be used without curly braces.
This error only happens when building on Windows. Building on Linux works just fine.
Reading the linker documentation at https://open-watcom.github.io/open-watcom-v2-wikidocs/lguide.html, the linker supports 2 kinds of syntax for accepting multiple arguments:
a list of object file names
file first,second,third,fourth
The alternate way of specifying this is as follows.
file {first second third fourth}
Because the generated response file contains library libconv.lib library mmpm2.lib
, it should be added without curly braces.
Edited by Brad King