cotire and clang, modificated system header files fail build
Currently if a system header file included in a generated pch file gets trivially changed (like new write date without modifications) clang errors due to
fatal error: file '/usr/include/pthread.h' has been modified since the precompiled header '...' was built
note: please rebuild precompiled header '...'
Is there someway cotire could add checks so that it rebuilds them if needed? compiling an empty file with included pch seems to be a valid check for it.
Which generator due you use?
Makefile
Dependencies are completely handled by the build system that CMake creates. Cotire is passive and relies on the build system triggering a re-build of the precompiled header when it is necessary. For that purpose cotire uses the IMPLICIT_DEPENDS option which makes CMake scan the precompiled header dependencies at build time. Interestingly this does not seem to work in your case.
Which compiler do you use? Do you also use a compiler wrapper (e.g., ccache)?
I am using Clang without any wrapper.
If I change include files inside the project everything works fine. I am talking about system wide header files, which are not included tracked by cmake in any way.
This still happens regularly.
CMake triggers a rebuild of every affected in-project source file but not the PCH.
It also affects GCC. There it doesn’t even warn – not even with -Winvalid-pch, it just uses the outdated PCH.
+:
I also came across Clang’s -verify-pch, although according to the above explanation that shouldn’t be necessary.
Still an issue for me with clang