Skip to content

Commit f4c1f89

Browse files
committed
Suggest using OS.has_feature instead of the engine architecture name for bitness
1 parent a0cd8f1 commit f4c1f89

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

doc/classes/Engine.xml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,7 @@
1313
<return type="String" />
1414
<description>
1515
Returns the name of the CPU architecture the Godot binary was built for. Possible return values include [code]"x86_64"[/code], [code]"x86_32"[/code], [code]"arm64"[/code], [code]"arm32"[/code], [code]"rv64"[/code], [code]"riscv"[/code], [code]"ppc64"[/code], [code]"ppc"[/code], [code]"wasm64"[/code], and [code]"wasm32"[/code].
16-
To detect whether the current build is 64-bit, you can use the fact that all 64-bit architecture names contain [code]64[/code] in their name:
17-
[codeblocks]
18-
[gdscript]
19-
if "64" in Engine.get_architecture_name():
20-
print("Running a 64-bit build of Godot.")
21-
else:
22-
print("Running a 32-bit build of Godot.")
23-
[/gdscript]
24-
[csharp]
25-
if (Engine.GetArchitectureName().Contains("64"))
26-
GD.Print("Running a 64-bit build of Godot.");
27-
else
28-
GD.Print("Running a 32-bit build of Godot.");
29-
[/csharp]
30-
[/codeblocks]
16+
To detect whether the current build is 64-bit, or the type of architecture, don't use the architecture name. Instead, use [method OS.has_feature] to check for the [code]"64"[/code] feature tag, or tags such as [code]"x86"[/code] or [code]"arm"[/code]. See the [url=$DOCS_URL/tutorials/export/feature_tags.html]Feature Tags[/url] documentation for more details.
3117
[b]Note:[/b] This method does [i]not[/i] return the name of the system's CPU architecture (like [method OS.get_processor_name]). For example, when running an [code]x86_32[/code] Godot binary on an [code]x86_64[/code] system, the returned value will still be [code]"x86_32"[/code].
3218
</description>
3319
</method>

0 commit comments

Comments
 (0)