From 64a8e8ae350a734b2b8512c4bcbba6e56a8e814e Mon Sep 17 00:00:00 2001 From: Leo <114008189+Leoforever123@users.noreply.github.com> Date: Sat, 7 Dec 2024 11:21:24 +0800 Subject: [PATCH] Add support for loongarch64 (#2363) --- src/_premake_init.lua | 1 + src/base/_foundation.lua | 1 + src/host/premake.h | 2 ++ website/docs/architecture.md | 1 + 4 files changed, 5 insertions(+) diff --git a/src/_premake_init.lua b/src/_premake_init.lua index 184f0c43..d40558df 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -29,6 +29,7 @@ p.ARM, p.ARM64, p.RISCV64, + p.LOONGARCH64 }, aliases = { i386 = p.X86, diff --git a/src/base/_foundation.lua b/src/base/_foundation.lua index 411eb536..4581d2c0 100644 --- a/src/base/_foundation.lua +++ b/src/base/_foundation.lua @@ -62,6 +62,7 @@ premake.ARM = "ARM" premake.ARM64 = "ARM64" premake.RISCV64 = "RISCV64" + premake.LOONGARCH64 = "loongarch64" diff --git a/src/host/premake.h b/src/host/premake.h index 788f8a38..4e15b863 100644 --- a/src/host/premake.h +++ b/src/host/premake.h @@ -62,6 +62,8 @@ #define PLATFORM_ARCHITECTURE "ARM" #elif defined(_M_RISCV64) || (defined(__riscv) && __riscv_xlen == 64) #define PLATFORM_ARCHITECTURE "RISCV64" +#elif (defined(__loongarch__) && __loongarch_grlen == 64) || defined(__loongarch64) +#define PLATFORM_ARCHITECTURE "loongarch64" #elif !defined(RC_INVOKED) #error Unknown architecture detected #endif diff --git a/website/docs/architecture.md b/website/docs/architecture.md index 0dbe352e..e7f4283f 100644 --- a/website/docs/architecture.md +++ b/website/docs/architecture.md @@ -14,6 +14,7 @@ architecture ("value") * `ARM` * `ARM64` * `RISCV64` +* `loongarch64` * `armv5`: Only supported in VSAndroid projects * `armv7`: Only supported in VSAndroid projects * `aarch64`: Only supported in VSAndroid projects -- 2.45.2