Browse Source

SCU (single compilation unit) build docs

Add info to the buildsystem docs.
lawnjelly 2 years ago
parent
commit
a2fd3fd38e

+ 21 - 0
contributing/development/compiling/introduction_to_the_buildsystem.rst

@@ -365,6 +365,27 @@ aforementioned ``-j`` option for all future builds:
 
 
      $env:SCONSFLAGS="-j4"
      $env:SCONSFLAGS="-j4"
 
 
+SCU (single compilation unit) build
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Regular builds tend to be bottlenecked by including large numbers of headers
+in each compilation translation unit. Primarily to speed up development (rather
+than for production builds), Godot offers a "single compilation unit" build
+(aka "Unity / Jumbo" build).
+
+For the folders accelerated by this option, multiple ``.cpp`` files are
+compiled in each translation unit, so headers can be shared between multiple
+files, which can dramatically decrease build times.
+
+To make a SCU build, use the ``scu_build=yes`` SCons option.
+
+.. note:: When developing a Pull Request using SCU builds, be sure to make a
+          regular build prior to submitting the PR. This is because SCU builds
+          by nature include headers from earlier ``.cpp`` files in the
+          translation unit, therefore won't catch all the includes you will
+          need in a regular build. The CI will catch these errors but it will
+          usually be faster to catch them on a local build on your machine.
+
 Export templates
 Export templates
 ----------------
 ----------------