diff options
| author | Vladimir Smirnov <civiloid@google.com> | 2021-05-02 14:56:16 +0200 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2021-05-06 14:03:30 +0200 |
| commit | 81f1c8a41bd1427707f402450de8820816760fca (patch) | |
| tree | 29ba81f3b678c307526d16b1ddd8b363b692c18d | |
| parent | 9d74e168501c37c5f49d6f995581eaefc8f164dc (diff) | |
| download | Project-Tick-81f1c8a41bd1427707f402450de8820816760fca.tar.gz Project-Tick-81f1c8a41bd1427707f402450de8820816760fca.zip | |
Fix cmake detection of risc-v (32 and 64 bit)
Add a case to detect risc-v architectures.
Fixes #941
| -rw-r--r-- | cmake/detect-arch.c | 7 | ||||
| -rw-r--r-- | cmake/detect-arch.cmake | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/cmake/detect-arch.c b/cmake/detect-arch.c index 571553582a..c8bad4beda 100644 --- a/cmake/detect-arch.c +++ b/cmake/detect-arch.c @@ -93,6 +93,13 @@ #elif defined(__THW_RS6000) #error archfound rs6000 +// RISC-V +#elif defined(__riscv) + #if __riscv_xlen == 64 + #error archfound riscv64 + #elif __riscv_xlen == 32 + #error archfound riscv32 + // return 'unrecognized' if we do not know what architecture this is #else #error archfound unrecognized diff --git a/cmake/detect-arch.cmake b/cmake/detect-arch.cmake index 69475da38d..76b52b9f36 100644 --- a/cmake/detect-arch.cmake +++ b/cmake/detect-arch.cmake @@ -85,6 +85,9 @@ elseif("${ARCH}" MATCHES "parisc") elseif("${ARCH}" MATCHES "rs6000") set(BASEARCH "rs6000") set(BASEARCH_RS6000_FOUND TRUE) +elseif("${ARCH}" MATCHES "riscv(32|64)") + set(BASEARCH "riscv") + set(BASEARCH_RISCV_FOUND TRUE) else() set(BASEARCH "x86") set(BASEARCH_X86_FOUND TRUE) |
