[cmake] Fix default build type and unity build via env var

Signed-off-by: Andrei Shkrob <andrei@shkrob.dev>
This commit is contained in:
Andrei Shkrob
2025-06-05 19:52:45 +02:00
committed by Konstantin Pastbin
parent d327bc5b82
commit bd563e6abb

View File

@@ -1,5 +1,12 @@
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type") if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif ()
option(CMAKE_UNITY_BUILD "Use unity build" ON) option(CMAKE_UNITY_BUILD "Use unity build" ON)
if (DEFINED ENV{CMAKE_UNITY_BUILD})
set(CMAKE_UNITY_BUILD $ENV{CMAKE_UNITY_BUILD})
endif ()
set(CMAKE_UNITY_BUILD_BATCH_SIZE "24" 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(USE_CCACHE "Use ccache" ON)
option(WITH_SYSTEM_PROVIDED_3PARTY "Enable compilation with system provided dependencies" OFF) option(WITH_SYSTEM_PROVIDED_3PARTY "Enable compilation with system provided dependencies" OFF)