Skip to content

Resolve "refactor(build): simplify PCH usage"

Flavien BRIDAULT requested to merge 948-refactor-build-simplify-pch-usage into dev

Description

To solve the issues described in #948 (closed), we now provide a single pch file. It only contains 3rd part libraries headers. The list was extracted from the previous pchServices recursive list, by removing all sight headers. It is also built in a second version for the targets that use optimized debug builds. During tests, we realized the build timings remain stable and even outperform sometimes the previous approach.

On Clang, we also took the opportunity to use a new feature that speedups PCH builds: http://llunak.blogspot.com/2021/04/clang-precompiled-headers-and-improving.html. The gain was measured at 10%.

This should allow using PCH builds reliably on the CI runners.

Closes #948 (closed)

Extra changes

  • OpenMP is now enabled globally. This should be safe on modern compilers and target architectures.
  • While looking for the minimal std/boost headers set, some cleaning was done to remove unused headers or deprecated symbols/files.

How to test it?

  • Nothing special.

Some results

PCH Compiler Target Build %CPU Time
Old Clang SightViewer Debug 1126 5:57
New Clang SightViewer Debug 1148 5:14
Old GCC SightViewer Debug 1138 8:36
New GCC SightViewer Debug 1106 7:52
Old MSVC SightViewer Debug 1138 7:30
New MSVC SightViewer Debug 1106 7:56
Old GCC SightViewer Release 1119 9:15
New GCC SightViewer Release 1136 9:15
Edited by Flavien BRIDAULT

Merge request reports