Request for Enhancement: Access to the paths for the obj files for precompiled headers
Breakout from #24893 (comment 1362552)
The above linked comment by myself contains code that demonstrates a usecase for providing some mechanism to interrogate a target for the path(s) for the precompiled header's object file.
As shown in the sample code, this information (which in the example is constructed "manually", and thus brittle and subject to breakage if/when cmake changes paths) is used to inform the underlying build system (e.g. Ninja) that some target described by add_custom_command()
depends on the precompiled header's object file existing.
In the example code, the thing that depends on this is a custom linter implementation that separates linting from compiling, so that analysis can be done without having already compiled the code, and without compiling the code simultaneously.
However, this means that if the code being analyzed includes precompiled headers, those precompiled headers must be already compiled before executing the analysis.
If CMake were to expose these paths, such as via a generator expression, then projects using cmake would have much more flexibility in how to make use of CMake.
Alternatively, if cmake were to create an implicit target for "compile the precompiled header(s) for target x", that would be sufficient for my purposes. I would prefer just being given the paths so i can do it myself, but either solution satisfies my immediate need.