1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-07 17:36:07 +00:00

Print expected os.arch tuple for current platform in GDExtension error

This also adds `Engine.get_architecture_name()` to get the name of the
CPU architecture the Godot binary was built for.
This commit is contained in:
Hugo Locurcio
2022-07-20 19:05:49 +02:00
parent 862dedcefe
commit 27a072c884
6 changed files with 64 additions and 3 deletions

View File

@@ -181,6 +181,42 @@ String Engine::get_license_text() const {
return String(GODOT_LICENSE_TEXT);
}
String Engine::get_architecture_name() const {
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) || defined(_M_X64)
return "x86_64";
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
return "x86_32";
#elif defined(__aarch64__) || defined(_M_ARM64)
return "arm64";
#elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7S__)
return "armv7";
#elif defined(__riscv)
#if __riscv_xlen == 8
return "rv64";
#else
return "riscv";
#endif
#elif defined(__powerpc__)
#if defined(__powerpc64__)
return "ppc64";
#else
return "ppc";
#endif
#elif defined(__wasm__)
#if defined(__wasm64__)
return "wasm64";
#elif defined(__wasm32__)
return "wasm32";
#endif
#endif
}
bool Engine::is_abort_on_gpu_errors_enabled() const {
return abort_on_gpu_errors;
}