Skip to content

Commit e0693f8

Browse files
committedDec 5, 2024
Add loongarch64 support
1 parent 47bc374 commit e0693f8

File tree

8 files changed

+16
-4
lines changed

8 files changed

+16
-4
lines changed
 

‎core/config/engine.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ String Engine::get_architecture_name() const {
248248
return "ppc";
249249
#endif
250250

251+
#elif defined(__loongarch64)
252+
return "loongarch64";
253+
251254
#elif defined(__wasm__)
252255
#if defined(__wasm64__)
253256
return "wasm64";

‎core/os/os.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,10 @@ bool OS::has_feature(const String &p_feature) {
518518
if (p_feature == "wasm") {
519519
return true;
520520
}
521+
#elif defined(__loongarch64)
522+
if (p_feature == "loongarch64") {
523+
return true;
524+
}
521525
#endif
522526

523527
#if defined(IOS_SIMULATOR)

‎editor/editor_property_name_processor.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() {
235235
capitalize_string_remaps["linuxbsd"] = "Linux/*BSD";
236236
capitalize_string_remaps["lod"] = "LOD";
237237
capitalize_string_remaps["lods"] = "LODs";
238+
capitalize_string_remaps["loongarch64"] = "loongarch64";
238239
capitalize_string_remaps["lowpass"] = "Low-pass";
239240
capitalize_string_remaps["macos"] = "macOS";
240241
capitalize_string_remaps["mb"] = "(MB)"; // Unit.

‎editor/plugins/gdextension_export_plugin.h

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
7373
all_archs.insert("ppc32");
7474
all_archs.insert("ppc64");
7575
all_archs.insert("wasm32");
76+
all_archs.insert("loongarch64");
7677
all_archs.insert("universal");
7778

7879
HashSet<String> archs;

‎platform/linuxbsd/detect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def get_flags():
7373

7474
def configure(env: "SConsEnvironment"):
7575
# Validate arch.
76-
supported_arches = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64"]
76+
supported_arches = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "loongarch64"]
7777
validate_arch(env["arch"], get_name(), supported_arches)
7878

7979
## Build type

‎platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<members>
1212
<member name="binary_format/architecture" type="String" setter="" getter="">
1313
Application executable architecture.
14-
Supported architectures: [code]x86_32[/code], [code]x86_64[/code], [code]arm64[/code], [code]arm32[/code], [code]rv64[/code], [code]ppc64[/code], and [code]ppc32[/code].
14+
Supported architectures: [code]x86_32[/code], [code]x86_64[/code], [code]arm64[/code], [code]arm32[/code], [code]rv64[/code], [code]ppc64[/code], [code]ppc32[/code], and [code]loongarch64[/code].
1515
Official export templates include [code]x86_32[/code] and [code]x86_64[/code] binaries only.
1616
</member>
1717
<member name="binary_format/embed_pck" type="bool" setter="" getter="">

‎platform/linuxbsd/export/export_plugin.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ bool EditorExportPlatformLinuxBSD::get_export_option_visibility(const EditorExpo
180180
void EditorExportPlatformLinuxBSD::get_export_options(List<ExportOption> *r_options) const {
181181
EditorExportPlatformPC::get_export_options(r_options);
182182

183-
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "binary_format/architecture", PROPERTY_HINT_ENUM, "x86_64,x86_32,arm64,arm32,rv64,ppc64,ppc32"), "x86_64"));
183+
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "binary_format/architecture", PROPERTY_HINT_ENUM, "x86_64,x86_32,arm64,arm32,rv64,ppc64,ppc32,loongarch64"), "x86_64"));
184184

185185
String run_script = "#!/usr/bin/env bash\n"
186186
"export DISPLAY=:0\n"
@@ -282,6 +282,8 @@ String EditorExportPlatformLinuxBSD::_get_exe_arch(const String &p_path) const {
282282
return "arm64";
283283
case 0x00f3:
284284
return "rv64";
285+
case 0x0102:
286+
return "loongarch64";
285287
default:
286288
return "unknown";
287289
}

‎platform_methods.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
# CPU architecture options.
19-
architectures = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "wasm32"]
19+
architectures = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "wasm32", "loongarch64"]
2020
architecture_aliases = {
2121
"x86": "x86_32",
2222
"x64": "x86_64",
@@ -31,6 +31,7 @@
3131
"ppcle": "ppc32",
3232
"ppc": "ppc32",
3333
"ppc64le": "ppc64",
34+
"loong64": "loongarch64",
3435
}
3536

3637

0 commit comments

Comments
 (0)
Please sign in to comment.