Skip to content

Commit 66679c7

Browse files
NeroBurnerraulsntosMaran23clayjohn
authored
Document the Unification of tools/target build type configuration (#6316)
Document the Unification of tools/target build type configuration Introduced in godotengine/godot#66242 the `tools=yes/no` option was removed and merged into the `target` preset. Includes miscellaneous fixes identified during code review as well Co-authored-by: Raul Santos <raulsntos@gmail.com> Co-authored-by: Marius Hanl <66004280+Maran23@users.noreply.github.com> Co-authored-by: Clay John <claynjohn@gmail.com>
1 parent d6a4208 commit 66679c7

16 files changed

+162
-159
lines changed

development/compiling/compiling_for_android.rst

+16-16
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ root directory with the following arguments:
9494

9595
::
9696

97-
scons platform=android target=release android_arch=armv7
98-
scons platform=android target=release android_arch=arm64v8
97+
scons platform=android target=template_release arch=armv7
98+
scons platform=android target=template_release arch=arm64v8
9999
cd platform/android/java
100100
# On Windows
101101
.\gradlew generateGodotTemplates
@@ -109,8 +109,8 @@ The resulting APK will be located at ``bin/android_release.apk``.
109109

110110
::
111111

112-
scons platform=android target=release_debug android_arch=armv7
113-
scons platform=android target=release_debug android_arch=arm64v8
112+
scons platform=android target=template_debug arch=armv7
113+
scons platform=android target=template_debug arch=arm64v8
114114
cd platform/android/java
115115
# On Windows
116116
.\gradlew generateGodotTemplates
@@ -130,16 +130,16 @@ Adding support for x86 devices
130130
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131131

132132
If you also want to include support for x86 and x86-64 devices, run the SCons
133-
command a third and fourth time with the ``android_arch=x86``, and
134-
``android_arch=x86_64`` arguments before building the APK with Gradle. For
133+
command a third and fourth time with the ``arch=x86_32``, and
134+
``arch=x86_64`` arguments before building the APK with Gradle. For
135135
example, for the release template:
136136

137137
::
138138

139-
scons platform=android target=release android_arch=armv7
140-
scons platform=android target=release android_arch=arm64v8
141-
scons platform=android target=release android_arch=x86
142-
scons platform=android target=release android_arch=x86_64
139+
scons platform=android target=template_release arch=armv7
140+
scons platform=android target=template_release arch=arm64v8
141+
scons platform=android target=template_release arch=x86
142+
scons platform=android target=template_release arch=x86_64
143143
cd platform/android/java
144144
# On Windows
145145
.\gradlew generateGodotTemplates
@@ -214,10 +214,10 @@ root directory with the following arguments:
214214

215215
::
216216

217-
scons platform=android android_arch=armv7 production=yes tools=yes target=release_debug
218-
scons platform=android android_arch=arm64v8 production=yes tools=yes target=release_debug
219-
scons platform=android android_arch=x86 production=yes tools=yes target=release_debug
220-
scons platform=android android_arch=x86_64 production=yes tools=yes target=release_debug
217+
scons platform=android arch=armv7 production=yes target=editor
218+
scons platform=android arch=arm64v8 production=yes target=editor
219+
scons platform=android arch=x86 production=yes target=editor
220+
scons platform=android arch=x86_64 production=yes target=editor
221221
cd platform/android/java
222222
# On Windows
223223
.\gradlew generateGodotEditor
@@ -289,8 +289,8 @@ one of the following reasons:
289289

290290
- Make sure to use export templates that match your editor version; if
291291
you use a new Godot version, you *have* to update the templates too.
292-
- ``libgodot_android.so`` is not in ``libs/<android_arch>/``
293-
where ``<android_arch>`` is the device's architecture.
292+
- ``libgodot_android.so`` is not in ``libs/<arch>/``
293+
where ``<arch>`` is the device's architecture.
294294
- The device's architecture does not match the exported one(s).
295295
Make sure your templates were built for that device's architecture,
296296
and that the export settings included support for that architecture.

development/compiling/compiling_for_linuxbsd.rst

+16-12
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ manager.
149149

150150
.. note:: If you are compiling Godot for production use, then you can
151151
make the final executable smaller and faster by adding the
152-
SCons option ``target=release_debug``.
152+
SCons options ``target=template_release production=yes``.
153153

154154
If you are compiling Godot with GCC, you can make the binary
155155
even smaller and faster by adding the SCons option ``use_lto=yes``.
@@ -161,23 +161,27 @@ manager.
161161
:ref:`doc_data_paths_self_contained_mode` by creating a file called
162162
``._sc_`` or ``_sc_`` in the ``bin/`` folder.
163163

164-
Compiling a headless/server build
165-
---------------------------------
164+
Running a headless/server build
165+
-------------------------------
166166

167-
To compile a *headless* build which provides editor functionality to export
168-
projects in an automated manner, use::
167+
To run in *headless* mode which provides editor functionality to export
168+
projects in an automated manner, use the normal build::
169169

170-
scons -j8 platform=server tools=yes target=release_debug
170+
scons -j8 platform=linuxbsd target=editor
171+
172+
And then use the ``--headless`` command line argument::
173+
174+
./bin/godot.linuxbsd.editor.x86_64 --headless
171175

172176
To compile a debug *server* build which can be used with
173177
:ref:`remote debugging tools <doc_command_line_tutorial>`, use::
174178

175-
scons -j8 platform=server tools=no target=release_debug
179+
scons -j8 platform=linuxbsd target=template_debug
176180

177181
To compile a *server* build which is optimized to run dedicated game servers,
178182
use::
179183

180-
scons -j8 platform=server tools=no target=release
184+
scons -j8 platform=linuxbsd target=template_release production=yes
181185

182186
Building export templates
183187
-------------------------
@@ -197,15 +201,15 @@ following parameters:
197201

198202
::
199203

200-
scons platform=linuxbsd tools=no target=release bits=32
201-
scons platform=linuxbsd tools=no target=release_debug bits=32
204+
scons platform=linuxbsd target=template_release arch=x86_32
205+
scons platform=linuxbsd target=template_debug arch=x86_32
202206

203207
- (64 bits)
204208

205209
::
206210

207-
scons platform=linuxbsd tools=no target=release bits=64
208-
scons platform=linuxbsd tools=no target=release_debug bits=64
211+
scons platform=linuxbsd target=template_release arch=x86_64
212+
scons platform=linuxbsd target=template_debug arch=x86_64
209213

210214
Note that cross-compiling for the opposite bits (64/32) as your host
211215
platform is not always straight-forward and might need a chroot environment.

development/compiling/compiling_for_macos.rst

+18-14
Original file line numberDiff line numberDiff line change
@@ -94,44 +94,48 @@ editor binary built with ``target=release_debug``::
9494
mkdir -p Godot.app/Contents/Frameworks
9595
cp <Vulkan SDK path>/macOS/lib/libMoltenVK.dylib Godot.app/Contents/Frameworks/libMoltenVK.dylib
9696

97-
Compiling a headless/server build
98-
---------------------------------
97+
Running a headless/server build
98+
-------------------------------
9999

100-
To compile a *headless* build which provides editor functionality to export
101-
projects in an automated manner, use::
100+
To run in *headless* mode which provides editor functionality to export
101+
projects in an automated manner, use the normal build::
102102

103-
scons platform=server tools=yes target=release_debug --jobs=$(sysctl -n hw.logicalcpu)
103+
scons platform=macos target=editor --jobs=$(sysctl -n hw.logicalcpu)
104+
105+
And then use the ``--headless`` command line argument::
106+
107+
./bin/godot.macos.editor.x86_64 --headless
104108

105109
To compile a debug *server* build which can be used with
106110
:ref:`remote debugging tools <doc_command_line_tutorial>`, use::
107111

108-
scons platform=server tools=no target=release_debug --jobs=$(sysctl -n hw.logicalcpu)
112+
scons platform=macos target=template_debug --jobs=$(sysctl -n hw.logicalcpu)
109113

110114
To compile a release *server* build which is optimized to run dedicated game servers,
111115
use::
112116

113-
scons platform=server tools=no target=release --jobs=$(sysctl -n hw.logicalcpu)
117+
scons platform=macos target=template_release production=yes --jobs=$(sysctl -n hw.logicalcpu)
114118

115119
Building export templates
116120
-------------------------
117121

118-
To build macOS export templates, you have to compile with ``tools=no`` (no
119-
editor) and respectively for ``target=release`` (release template) and
120-
``target=release_debug``.
122+
To build macOS export templates, you have to compile using the targets without
123+
the editor: ``target=template_release`` (release template) and
124+
``target=template_debug``.
121125

122126
Official templates are universal binaries which support both Intel x86_64 and
123127
ARM64 architectures. You can also create export templates that support only one
124128
of those two architectures by leaving out the ``lipo`` step below.
125129

126130
- For Intel x86_64::
127131

128-
scons platform=macos tools=no target=release arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)
129-
scons platform=macos tools=no target=release_debug arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)
132+
scons platform=macos target=template_release arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)
133+
scons platform=macos target=template_debug arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)
130134

131135
- For ARM64 (Apple M1)::
132136

133-
scons platform=macos tools=no target=release arch=arm64 --jobs=$(sysctl -n hw.logicalcpu)
134-
scons platform=macos tools=no target=release_debug arch=arm64 --jobs=$(sysctl -n hw.logicalcpu)
137+
scons platform=macos target=template_release arch=arm64 --jobs=$(sysctl -n hw.logicalcpu)
138+
scons platform=macos target=template_debug arch=arm64 --jobs=$(sysctl -n hw.logicalcpu)
135139

136140
To support both architectures in a single "Universal 2" binary, run the above
137141
two commands blocks and then use ``lipo`` to bundle them together::

development/compiling/compiling_for_uwp.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ be able to export.
6666
Open the command prompt for one architecture and run SCons twice (once for
6767
each target)::
6868

69-
C:\godot>scons platform=uwp target=release_debug
70-
C:\godot>scons platform=uwp target=release
69+
C:\godot>scons platform=uwp target=template_debug
70+
C:\godot>scons platform=uwp target=template_release
7171

7272
Repeat for the other architectures.
7373

development/compiling/compiling_for_web.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ and ``source ./emsdk_env.sh``/``emsdk_env.bat``.
3434

3535
Open a terminal and navigate to the root directory of the engine source code.
3636
Then instruct SCons to build the Web platform. Specify ``target`` as
37-
either ``release`` for a release build or ``release_debug`` for a debug build::
37+
either ``template_release`` for a release build or ``template_debug`` for a debug build::
3838

39-
scons platform=web tools=no target=release
40-
scons platform=web tools=no target=release_debug
39+
scons platform=web target=template_release
40+
scons platform=web target=template_debug
4141

4242
By default, the :ref:`JavaScript singleton <doc_javascript_eval>` will be built
4343
into the engine. Official export templates also have the JavaScript singleton
4444
enabled. Since ``eval()`` calls can be a security concern, the
4545
``javascript_eval`` option can be used to build without the singleton::
4646

47-
scons platform=web tools=no target=release javascript_eval=no
48-
scons platform=web tools=no target=release_debug javascript_eval=no
47+
scons platform=web target=template_release javascript_eval=no
48+
scons platform=web target=template_debug javascript_eval=no
4949

5050
The engine will now be compiled to WebAssembly by Emscripten. Once finished,
5151
the resulting file will be placed in the ``bin`` subdirectory. Its name is
@@ -71,8 +71,8 @@ performance and compatibility reasons. See the
7171
You can build the export templates using the option ``dlink_enabled=yes``
7272
to enable GDExtension support::
7373

74-
scons platform=web tools=no dlink_enabled=yes target=release
75-
scons platform=web tools=no dlink_enabled=yes target=release_debug
74+
scons platform=web dlink_enabled=yes target=template_release
75+
scons platform=web dlink_enabled=yes target=template_debug
7676

7777
Once finished, the resulting file will be placed in the ``bin`` subdirectory.
7878
Its name will have ``_dlink`` added.
@@ -90,7 +90,7 @@ It is also possible to build a version of the Godot editor that can run in the
9090
browser. The editor version is not recommended
9191
over the native build. You can build the editor with::
9292

93-
scons platform=web tools=yes target=release_debug
93+
scons platform=web target=editor
9494

9595
Once finished, the resulting file will be placed in the ``bin`` subdirectory.
9696
Its name will be ``godot.web.opt.tools.wasm32.zip``. You can upload the

development/compiling/compiling_for_windows.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ option to any SCons command you see below.
149149
If all goes well, the resulting binary executable will be placed in
150150
``C:\godot\bin\`` with the name ``godot.windows.tools.32.exe`` or
151151
``godot.windows.tools.64.exe``. By default, SCons will build a binary matching
152-
your CPU architecture, but this can be overridden using ``bits=64`` or
153-
``bits=32``.
152+
your CPU architecture, but this can be overridden using ``arch=x86_64`` or
153+
``arch=x86_32``.
154154

155155
This executable file contains the whole engine and runs without any
156156
dependencies. Running it will bring up the Project Manager.
157157

158158
.. note:: If you are compiling Godot for production use, then you can
159159
make the final executable smaller and faster by adding the
160-
SCons option ``target=release_debug``.
160+
SCons option ``target=template_release``.
161161

162162
If you are compiling Godot with MinGW, you can make the binary
163163
even smaller and faster by adding the SCons option ``use_lto=yes``.
@@ -269,10 +269,10 @@ Creating Windows export templates
269269
Windows export templates are created by compiling Godot without the editor,
270270
with the following flags::
271271

272-
C:\godot> scons platform=windows tools=no target=release_debug bits=32
273-
C:\godot> scons platform=windows tools=no target=release bits=32
274-
C:\godot> scons platform=windows tools=no target=release_debug bits=64
275-
C:\godot> scons platform=windows tools=no target=release bits=64
272+
C:\godot> scons platform=windows target=template_debug arch=x86_32
273+
C:\godot> scons platform=windows target=template_release arch=x86_32
274+
C:\godot> scons platform=windows target=template_debug arch=x86_64
275+
C:\godot> scons platform=windows target=template_release arch=x86_64
276276

277277
If you plan on replacing the standard export templates, copy these to the
278278
following location, replacing ``<version>`` with the version identifier

0 commit comments

Comments
 (0)