AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

Winres.xml definition bug, broken command syntax when using parameters such as --include-dir. Error description and recommended change described. #76

Closed nthcomputing closed 4 years ago

nthcomputing commented 4 years ago

Hi, Since I didn't see a way to place a patch myself in the GitHub interface, I'm relaying this here. The winres.xml in share/gprconfig is incorrectly setup.

The current XML definition states: For Leading_Required_Switches ("WinRes") use ("-i");

This leads to the command usage error being thrown up for any additional options I put in. Like --include-dir.

EXAMPLE. Using the definition AS-IS this happens (Wxwidgets Sample.rc): My project file would define windres as a language required to build the project and have this single line: for Default_Switches("WinRes") USE ("--include-dir=C:\msys64\usr\local\include\wx-3.1\");

When using gprbuild with -vh, I see the command forms like this (in error): C:\msys64\mingw32\bin\windres.exe -i --include-dir=C:\msys64\usr\local\include\wx-3.1\ C:\Users\user\Documents\sample.rc -o sample.coff

Notice the -i in the front, but then any optional parameter in placed in there, splitting the input file parameter (sample.rc). I've been fixing this for a several years by changing the XML definition file to :

For Trailing_Required_Switches ("WinRes") use ("-i");

With this small change, I then see this successful windres compilation statement: C:\msys64\mingw32\bin\windres.exe --include-dir=C:\msys64\usr\local\include\wx-3.1\ -i C:\Users\user\Documents\sample.rc -o sample.coff

I'm pretty sure this is the right answer, if there is a better statement position, please let me know. Failing a better suggestion, please make the above change to correct the windress usage error that occurs now.

Thanks.

t-14 commented 4 years ago

Thank you for your suggestion, we have adjusted the knowledge base accordingly.