Build: add global precompiled header #111225

Open
Aras Pranckevicius wants to merge 5 commits from aras_p/blender:global_pch into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

5 Commits

Author SHA1 Message Date
Aras Pranckevicius 29393e3fc2 Merge branch 'main' into global_pch
buildbot/vexp-code-patch-coordinator Build done. Details
2023-08-24 14:49:26 +03:00
Aras Pranckevicius ec27abd5d5 Build: revert "share precompiled headers from base bf_pch library"
buildbot/vexp-code-patch-coordinator Build done. Details
REUSE_FROM causes some issues with transitive library dependencies
on MSVC generator (see https://gitlab.kitware.com/cmake/cmake/-/issues/22630
where a similar issue was solved, but the developer comments indicate
that in more intricate cases the issue remains).

With REUSE_FROM, some targets do not link, but only in Debug config.
e.g. bf_blenlib wrongly tries to link with
build_windows_x64_vc17_Release\source\blender\pch\bf_pch.dir\Debug\cmake_pch.obj
which simply does not exist since nothing produces that.
2023-08-24 14:15:32 +03:00
Aras Pranckevicius 010353a46e Build: share precompiled headers from base bf_pch library
buildbot/vexp-code-patch-coordinator Build done. Details
On Apple M1 Max "make debug developer ninja" the ninja part
of empty build goes 331s -> 302s with PCH usage (no measurable
difference between shared and non-shared PCHs).

Editing BKE_attribute.hh and building "blender" target afterwards
goes 71s -> 68s.
2023-08-20 16:26:24 +03:00
Aras Pranckevicius ee11f3a3fa Build: tweaks to make Mac build with ninja backend
buildbot/vexp-code-patch-coordinator Build done. Details
Ninja puts both C and ObjC to use the same precompiled header,
which then does not work. So explicitly tell cmake to not use
PCHs on ObjC source files.
2023-08-19 10:24:36 +03:00
Aras Pranckevicius 39e207e78d Build: add global precompiled header
PCH includes commonly used STL bits: algorithm, atomic, memory, string,
vector. VS2022 Release ("make developer") build of blender:
7m10s -> 6m30s (Ryzen 5950X)

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
2023-08-19 08:58:00 +03:00