[cmake] Reduce default unity batch size to 24

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-06-02 18:21:12 +07:00
committed by Konstantin Pastbin
parent 10bc524571
commit 209b0d5d5b
2 changed files with 3 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type")
option(CMAKE_UNITY_BUILD "Use unity build" ON)
set(CMAKE_UNITY_BUILD_BATCH_SIZE "50" CACHE STRING "Batch size for unity build")
set(CMAKE_UNITY_BUILD_BATCH_SIZE "24" CACHE STRING "Batch size for unity build")
option(USE_CCACHE "Use ccache" ON)
option(WITH_SYSTEM_PROVIDED_3PARTY "Enable compilation with system provided dependencies" OFF)
option(BUILD_DESIGNER "Build application as design tool" OFF)

View File

@@ -162,8 +162,8 @@ tools/unix/build_omim.sh -d help
- If you get "not enough memory" errors during builds, you may disable
[CMake Unity Builds](https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html) by passing
`-DCMAKE_UNITY_BUILD=OFF` option to `cmake` invocation. Or you can reduce Unity build batch size from
the default `50` to a lower value (`2`-`16`) by passing `-DCMAKE_UNITY_BUILD_BATCH_SIZE=8`.
Note that these changes may significantly increase the build time.
the default `24` to a lower value (`2`-`16`) by passing `-DCMAKE_UNITY_BUILD_BATCH_SIZE=8`.
Note that these changes may significantly increase the full build time.
### Running