[Qt-creator] pro file parsing in cumulative mode really necessary?

Tilman Vogel tilman.vogel at web.de
Mon Apr 19 14:30:10 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 19.04.2010 11:02, schrieb Daniel Teske:
> Yes it is. In cumulative mode the following is parsed as if both if 
> branches are taken, regardless of platform.
> 
> win32 {
>    SOURCES += process_win.cpp
> }
> unix {
>    SOURCRS += process_unix.cpp
> }
> 
> The cumulative mode is based on the linguist parsing of .pro files which 
> tries to find all the releveant source files regardless of scoping.

Sorry, didn't comment on that in my first reply. Thanks for the hint.
I see that you want to collect all SOURCES. In this case, you could just
go ahead and evaluate both branches because the statement itself is
actually appending, but I understand that there are cases like this

win32 {
  APPENDIX = win
}
unix {
  APPENDIX = unix
}

SOURCES += process_$${APPENDIX}.cpp

and then just evaluating both branches will miss "win", so "=" needs to
be cumulative too, but I guess the only solution is then to really use a
cartesian product because even now, this will give

SOURCES += process_"win unix".cpp

instead of

SOURCES += process_win.cpp process_unix.cpp

(didn't try this one).

Tilman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iEYEARECAAYFAkvMTNIACgkQ9ZPu6Yae8ll+QgCggUHPF/yHWj4t6a2OMqi66hak
ZvYAniqGnhw5usa6QcsUXqqd+443zzyD
=NN1c
-----END PGP SIGNATURE-----



More information about the Qt-creator-old mailing list