cmake: fix PCH to work with msvc/ninja

Ninja puts way more effort into compiling targets in parallel, and
ignores dependenceis until link time.

So we need to jump though hoops to force ninja to compile
pch.cpp before any targets which depend on the PCH.
This commit is contained in:
Scott Mansell
2022-04-28 17:18:07 +12:00
committed by Admiral H. Curtiss
parent 89fda54820
commit 876f6651b4
2 changed files with 29 additions and 10 deletions

View File

@ -312,7 +312,7 @@ endif()
if(MSVC)
# Add precompiled header
# it will propergate down to everything that depends on common
target_link_libraries(common PUBLIC pch)
target_link_libraries(common PUBLIC use_pch)
# We need to disable PCH for this one file, because it's C and our PCH is C++
set_source_files_properties(