PCH: Manual rebuilds necessary with target_precompile_headers( ... REUSE_FROM ...)
When using target_precompile_headers(Bar REUSE_FROM Foo) with the Visual Studio 16 (2019) generator I occasionally run into the problem that all or some consuming targets need an explicit "Rebuild" in Visual Studio. The errors are all linker related and it is unclear to me, what prompts one or the other for each of the projects:
- fatal error LNK1318: Unexpected PDB error; OK (0) ''
- fatal error LNK1120: unresolved externals.
- fatal error LNK1103: debugging information corrupt; recompile module
So far I was unable to reproduce this in the minimal example. The target builds again when touching all source files or when explicitly triggering a target only rebuilt.