CMake 3.18 PCH clarification
Good day, I have strange behaviour, perhaps you can give some advice why this can be happened. When I try to compile executable target, that depends on a few more executables, and they all depend on base library, I got error:
C1041: Cannot open program database if multiple CL.EXE write to the same .PDB file, please use /FS
Base library defines precompile header:
target_precompile_headers(${PROJECT_NAME} PUBLIC "stdafx.h")
and all other targets use this precompile header like this:
target_precompile_headers(${PROJECT_NAME} REUSE_FROM ${SDK_LIBRARY})
The strangest thing is that this error is reproducible only when I compile the project via Visual Studio, if I use the command line everything works fine. When I remove the precompile header reuse, I manage to compile the solution via Visual Studio. Also this issue started to reproduce when I updated cmake to 3.18. I also checked cmake 3.17.5 and I didn't have this issue.