Skip to content

Commit

Permalink
Add support for riscv64 (#2356)
Browse files Browse the repository at this point in the history
* Add support for riscv64
* Make error message clear when architecture is unknown
  • Loading branch information
kxxt authored Dec 5, 2024
1 parent 7f2a0c8 commit 82c9d90
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/_premake_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
p.X86_64,
p.ARM,
p.ARM64,
p.RISCV64,
},
aliases = {
i386 = p.X86,
Expand Down
1 change: 1 addition & 0 deletions src/base/_foundation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
premake.X86_64 = "x86_64"
premake.ARM = "ARM"
premake.ARM64 = "ARM64"
premake.RISCV64 = "RISCV64"



Expand Down
4 changes: 4 additions & 0 deletions src/host/premake.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
#elif defined(__arm__) || defined(__thumb__) || defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) || \
defined(__ARM) || defined(_M_ARM) || defined(_M_ARM_T) || defined(__ARM_ARCH)
#define PLATFORM_ARCHITECTURE "ARM"
#elif defined(_M_RISCV64) || (defined(__riscv) && __riscv_xlen == 64)
#define PLATFORM_ARCHITECTURE "RISCV64"
#elif !defined(RC_INVOKED)
#error Unknown architecture detected
#endif

/* Pull in platform-specific headers required by built-in functions */
Expand Down
1 change: 1 addition & 0 deletions website/docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ architecture ("value")
* `x86_64`
* `ARM`
* `ARM64`
* `RISCV64`
* `armv5`: Only supported in VSAndroid projects
* `armv7`: Only supported in VSAndroid projects
* `aarch64`: Only supported in VSAndroid projects
Expand Down

0 comments on commit 82c9d90

Please sign in to comment.