[Bf-blender-cvs] [cd9ebc816ec] master: Fix build error with WITH_CYCLES_KERNEL_NATIVE_ONLY on macOS Arm

Brecht Van Lommel noreply at git.blender.org
Mon Jul 25 11:23:37 CEST 2022


Commit: cd9ebc816ece2ba7af95caa38cf3517131a9a361
Author: Brecht Van Lommel
Date:   Mon Jul 25 11:15:24 2022 +0200
Branches: master
https://developer.blender.org/rBcd9ebc816ece2ba7af95caa38cf3517131a9a361

Fix build error with WITH_CYCLES_KERNEL_NATIVE_ONLY on macOS Arm

-march=native is not supported for all architectures.

===================================================================

M	intern/cycles/CMakeLists.txt

===================================================================

diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 82fd81be262..89dad8ed36e 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -36,8 +36,13 @@ if(WITH_CYCLES_NATIVE_ONLY)
   )
 
   if(NOT MSVC)
-    string(APPEND CMAKE_CXX_FLAGS " -march=native")
-    set(CYCLES_KERNEL_FLAGS "-march=native")
+    ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_march_native "-march=native")
+    if(_has_march_native)
+      set(CYCLES_KERNEL_FLAGS "-march=native")
+    else()
+      set(CYCLES_KERNEL_FLAGS "")
+    endif()
+    unset(_has_march_native)
   else()
     if(NOT MSVC_NATIVE_ARCH_FLAGS)
         TRY_RUN(



More information about the Bf-blender-cvs mailing list