You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ML] Speed up C++ builds with unity builds, PCH, and Ninja on Windows
Enable CMake unity builds and precompiled headers (PCH) to reduce
compilation times. Use Ninja Multi-Config generator on Windows for
faster parallel compilation (downloaded on-demand during CI).
Unity builds:
- Enabled globally via -DCMAKE_UNITY_BUILD=ON (Windows/Linux)
- Disabled on macOS (counterproductive on 4-core Orka VMs)
- Disabled for MlApi and MlMathsAnalytics (too many symbol conflicts)
- Fix anonymous-namespace conflicts in core/ and maths/ sources
PCH:
- New ML_PCH option adds Boost headers as precompiled header targets
- Enabled via -DML_PCH=ON in CI pipeline environments
Ninja on Windows:
- Set CMAKE_GENERATOR=Ninja Multi-Config in Windows pipeline env
- build.ps1 downloads ninja.exe on-demand from GitHub releases when
not already on PATH
- Remove /Zi in favour of /Z7 (embedded debug info avoids PDB locking
issues with Ninja's parallel compilation)
Build system:
- build.gradle reads CMAKE_FLAGS from environment, allowing CI to
pass unity/PCH flags through to cmake configure
- Fix ML_DEBUG handling: use env-dict in pipeline generators (not
inline PowerShell commands) and restore debug build directory
selection in build/test scripts
Made-with: Cursor
0 commit comments