diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ab08739f7..16b6396bf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,9 @@ if (YUZU_STATIC_ROOM) set(fmt_FORCE_BUNDLED ON) endif() +# my unity/jumbo build +option(ENABLE_UNITY_BUILD "Enable Unity/Jumbo build" OFF) + # qt stuff option(ENABLE_QT "Enable the Qt frontend" ON) option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF) diff --git a/docs/Options.md b/docs/Options.md index 3eb6effe92..adb401eaf1 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -40,6 +40,7 @@ These options control dependencies. - This option is subject for removal. - `YUZU_TESTS` (ON) Compile tests - requires Catch2 - `ENABLE_LTO` (OFF) Enable link-time optimization +- `ENABLE_UNITY_BUILD` (OFF) Enables "Unity/Jumbo" builds - Not recommended on Windows - UNIX may be better off appending `-flto=thin` to compiler args - `USE_FASTER_LINKER` (OFF) Check if a faster linker is available diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a9fa5314b7..482fb45c6a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,6 +7,11 @@ # Enable modules to include each other's files include_directories(.) +if (ENABLE_UNITY_BUILD) + set(CMAKE_UNITY_BUILD ON) + set(CMAKE_UNITY_BUILD_BATCH_SIZE 5000) +endif() + # Dynarmic if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64 AND NOT YUZU_STATIC_ROOM) add_subdirectory(dynarmic)