From e3445f996a3b59e190ed3a851a1013ff4127532a Mon Sep 17 00:00:00 2001 From: Eric Long Date: Fri, 12 Jan 2024 15:33:34 +0800 Subject: [PATCH] CMakeList.txt: only fall back native flags to `-march=nehalem` on x86_64 This allows other architectures like RISC-V to build the library. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f89d2ed..d2d5db55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,8 +84,10 @@ elseif (APPLE AND ((CMAKE_OSX_ARCHITECTURES MATCHES "arm64") OR (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64"))) # Apple M1 compatibility set(NANOGUI_NATIVE_FLAGS_DEFAULT "-mcpu=apple-a12") -else() +elseif (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64") set(NANOGUI_NATIVE_FLAGS_DEFAULT "-march=nehalem") +else() + set(NANOGUI_NATIVE_FLAGS_DEFAULT "") endif() option(NANOGUI_BUILD_EXAMPLES "Build NanoGUI example application?" ON)