refactor(build): use CMake PCH targets
Description
Since version 3.17, CMake has finally provided support for precompiled headers. Our code is very complicated and sometimes a bit fragile, so this has been considered for a long time to switch the true CMake support. In addition, we hope this may fix our recurrent issues with Clang on the CI runners.
It was a bit challenging at the beginning, but since 5e1288c8 we have only two PCHs and it seems much easier to achieve
Functional specifications
- Use CMake
target_precompile_headers
function instead of our custom implementation - Build performances should remain identical
Technical specifications
- Use CMake
target_precompile_headers
for the two PCH targets (pchCore, pchCoreOg) - For all targets with PCH enabled, use
target_precompile_headers
with the REUSE_FROM signature to reuse pchCore and pchCoreOg.
Test plan
On all platforms/compilers:
- Build must be successful and achieve the same completion time
- Test debug capabilities (they should remain the same)
- Build with Sight from an external repository