[Qt-creator] Creator parsing too much (and incorrectly) qmake files?
Olivier B.
perso.olivier.barthelemy at gmail.com
Tue Dec 3 17:50:51 CET 2019
Thanks, I worked around it at the same time than your answer by making
sure the part before the slash is never empty.
But i still don't understand how this is expected behaviour. How can
creator expect to properly scan files if it does not respect the logic
inside them?
And apparently it is not scanning everything, since the lines that set
the variables have apparently not been executed, but the $$files that
uses that variable is executed?
Le mar. 3 déc. 2019 à 17:00, Christian Kandeler
<Christian.Kandeler at qt.io> a écrit :
>
> On Tue, 3 Dec 2019 16:49:05 +0100
> "Olivier B." <perso.olivier.barthelemy at gmail.com> wrote:
>
> > I encountered an issue with QtCreator after a minor modif of my project file
> >
> > I added in a pri include file a few lines that look like :
> > SOME_VAR = $$files($$SOME_OTHER_VAR/*, true)
> >
> > That particular pri file is included under a condition, so it is
> > actually included only in a 'automated' build, i order to speed up
> > qmake for normal developper that just run 'make' and don't need to
> > ruin 'make install'
> > A 'qmake -r' runs fine in an automated build that is expected to parse
> > the problematic lines, and in a user build that is expected to not
> > enter the file
> > However, because of those lines qtcreator seems to loop or be stuck,
> > while the status tooltip says that it is scanning the root .pro file.
> > This takes more and more memory until the computer stops responding
> >
> > What i think is happening is that creator does an other scan for
> > himself than the one qmake does, and is going through the include even
> > though the condition to include it is false.
>
> Yes, Creator evaluates also the "else" cases, in order to provide a complete view of the project (there might be SOURCES in there).
>
> > But as it is not supposed
> > to have parsed that file, it does not know the value of
> > $$SOME_OTHER_VAR, so it is actually doing multiple recursive scans of
> > /* (this is on linux) and storing that in variables
> >
> > I validated with messages that qmake is not entering that pri file,
> > and just commenting the $$files calls removes the problems.
> > Same behaviour in versions 4.8 and 4.9
> >
> > Any hints on how to avoid this issue?
>
> You could set SOME_OTHER_VAR to a random default value that is unlikely to correspond to an actual path.
>
>
> Christian
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> https://lists.qt-project.org/listinfo/qt-creator
More information about the Qt-creator
mailing list