[Qbs] lexyacc: flex on windows doesn't work with spaces between arguments keys and values

Алексей Скородумов 2350266 at gmail.com
Tue Feb 7 11:33:41 CET 2017


Hi,

Flex on windows (version 2.5.4a, from GnuWin32 project
<http://gnuwin32.sourceforge.net/packages/flex.htm>) doesn't accept
arguments with spaces. For example:

 C:\GnuWin32\bin\flex.exe -P scanner -o
E:/Project/default/compiler.MSVC2013-amd64.c9ce5223/lexyacc/scannerlex.yy.c
E:/Project/scanner.l
C:\GnuWin32\bin\flex.exe: can't open scanner

The same command works fine if there are no spaces between arguments keys
and values.

I fixed this by changing lexyacc.qbs (line 28):

old:
if (product.moduleProperty("lex_yacc", "uniqueSymbolPrefix"))
    args.push("-P", input.baseName, "-o", output.filePath);

new:
if (product.moduleProperty("lex_yacc", "uniqueSymbolPrefix"))
    args.push("-P" + input.baseName, "-o" + output.filePath);

This works for flex 2.5.4a on Windows and for lex 2.6.0 on Linux.

Hope this can be useful for others and may be devs can apply the fix in
mainstream repo as well.

----------------------------
Kind regards,
Aleksei Skorodumov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20170207/8ffae5c9/attachment.html>


More information about the Qbs mailing list