From a09c2b1affb6ac93d95ceeab1f17d0fe6d340b5b Mon Sep 17 00:00:00 2001 From: Kimoon Higashihira Han <98246499+kmnhan@users.noreply.github.com> Date: Fri, 5 Jun 2026 15:05:52 -0700 Subject: [PATCH] Allow compilation on non-x86_64 architectures (e.g., Apple Silicon) --- cpp/cmake/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/CMakeLists.txt b/cpp/cmake/CMakeLists.txt index 181d24e2..03815525 100644 --- a/cpp/cmake/CMakeLists.txt +++ b/cpp/cmake/CMakeLists.txt @@ -39,7 +39,10 @@ endif() # Setup definitions for all targets add_definitions(${SRW_DEFINITIONS}) -add_compile_options(-O3 -mfma) #HG01082025 +add_compile_options(-O3) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|i[3-6]86)$") + add_compile_options(-mfma) #HG01082025 +endif() #ext #auxgpu @@ -342,4 +345,4 @@ add_custom_command(TARGET srwlpy POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/env/python/srwpy/ ) -#install(TARGETS srwlpy LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) \ No newline at end of file +#install(TARGETS srwlpy LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})