diff options
| -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) |
