-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCH step doesn't depend on generated headers #2361
Comments
Another way would be to have PCH as a separate pseudo-target or just a method that can take source + header arguments, as well as a list of dependencies. Then, we could add arbitrary dependencies before generating the PCH without adding ALL generators as dependencies. |
The dependencies of pch compilation should be identical to regular compilation. It is not because of historical reasons. |
Fixed by #4860, please close. |
If a header to be precompiled includes a header that is generated during the build, meson doesn't create a proper dependency between them. This leads to ninja trying to precompile the pch before the headers it includes are generated.
Full example:
main.c:
generator.sh:
pch/pch.h:
meson.build:
The resulting build.ninja has an order-only dependency from
main.c.o
topch.h.gch bigheader.h
which ensures the compilation waits forbigheader.h
to be generated, but there is nothing makingbigheader.h
a dependency of the PCH step.On a
ninja -j1
this might work, but in a parallel build this leads to pch.h being precompiled before bigheader.h is generated.One way to solve this is to have meson put all the target's generated headers as order-only dependencies of the precompiled header. Although this might cause too-strict dependencies for the common case where the pch only includes external libraries, in which case I guess this needs an extra keyword argument to be explicit...
The text was updated successfully, but these errors were encountered: