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
commit 876f6651b4
No known key found for this signature in database
GPG key ID: F051B4C4044F33FB
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(