How to automatically rebuild a precompiled header using qmake when its dependencies change?

StackOverflow https://stackoverflow.com/questions/17100296

Frage

I'm using qmake's PRECOMPILED_HEADER variable to generate a precompiled header.

If one of the precompiled header's included headers changes, the precompiled header isn't rebuilt — instead, when clang tries to use the precompiled header, it fails with fatal error: file '...' has been modified since the precompiled header was built.

How can I tell qmake to automatically recompile the precompiled header when its dependencies change?

War es hilfreich?

Lösung

My problem was that I had CONFIG -= depend_includepath enabled, and I had added the precompiled header's headers to INCLUDEPATH but hadn't also added them to DEPENDPATH.

Andere Tipps

Edit prefix header anyhow. E.g if your precompiled header created from stdafx.h, open stdafx.h and type something, than delete it, save file and launch build again.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top