Skip to content

Commit 338c1f6

Browse files
committed
Update SCons link-time optimization option for 3.5 and later
1 parent ccae259 commit 338c1f6

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

contributing/development/compiling/compiling_for_linuxbsd.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Manager.
270270
SCons options ``target=template_release production=yes``.
271271

272272
If you are compiling Godot with GCC, you can make the binary
273-
even smaller and faster by adding the SCons option ``use_lto=yes``.
273+
even smaller and faster by adding the SCons option ``lto=full``.
274274
As link-time optimization is a memory-intensive process,
275275
this will require about 7 GB of available RAM while compiling.
276276

contributing/development/compiling/compiling_for_windows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ dependencies. Running it will bring up the Project Manager.
153153
SCons option ``target=template_release``.
154154

155155
If you are compiling Godot with MinGW, you can make the binary
156-
even smaller and faster by adding the SCons option ``use_lto=yes``.
156+
even smaller and faster by adding the SCons option ``lto=full``.
157157
As link-time optimization is a memory-intensive process,
158158
this will require about 7 GB of available RAM while compiling.
159159

contributing/development/compiling/optimizing_for_size.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ and MSVC compilers:
7979

8080
::
8181

82-
scons p=windows target=template_release use_lto=yes
82+
scons p=windows target=template_release lto=full
8383

8484
Linking becomes much slower and more RAM-consuming with this option,
8585
so it should be used only for release builds:

contributing/development/debugging/using_cpp_profilers.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,8 @@ To get useful profiling information, it is **absolutely required** to use a Godo
2929
build that includes debugging symbols. Official binaries do not include debugging
3030
symbols, since these would make the download size significantly larger.
3131

32-
To get profiling data that best matches the production environment, you should
33-
compile binaries with the following SCons options:
34-
35-
- For editor binaries: ``target=editor use_lto=yes``
36-
- For debug export templates: ``target=template_debug use_lto=yes``
37-
- For release export templates: ``target=template_release debug_symbols=yes``
38-
39-
- ``debug_symbols=yes`` is required as export templates are stripped from debugging symbols by default.
32+
To get profiling data that best matches the production environment (but with debugging symbols),
33+
you should compile binaries with the ``production=yes debug_symbols=yes`` SCons options.
4034

4135
It is possible to run a profiler on less optimized builds (e.g. ``target=template_debug`` without LTO),
4236
but results will naturally be less representative of real world conditions.

0 commit comments

Comments
 (0)