diff -bur BSDFProcessor-1.3.0-orig/CMakeLists.txt BSDFProcessor-1.3.0/CMakeLists.txt
--- BSDFProcessor-1.3.0-orig/CMakeLists.txt	2023-09-27 23:35:57.377393100 -0600
+++ BSDFProcessor-1.3.0/CMakeLists.txt	2023-09-27 23:58:35.375208400 -0600
@@ -57,8 +57,13 @@
     add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
 else()
     set(CMAKE_CXX_STANDARD 17)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3")
+    if( $ENV{MSYSTEM_CARCH} STREQUAL "aarch64")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+    else()
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3 -O2")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3 -O2")
+    endif()
 endif()
 
 find_package(OpenMP QUIET)
