diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-25 12:15:24 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-07-26 15:25:31 +0300 |
commit | ae3ca88d9ad07d7e55fd2c64b30896922dff7c18 (patch) | |
tree | 3d2947c6d2b527c4b4c56dd57b79fa93f253dc5d | |
parent | 05da26222b871be11a246f38c9a559f646ab855b (diff) |
Fix build error with WITH_CYCLES_KERNEL_NATIVE_ONLY on macOS Arm
-march=native is not supported for all architectures.
-rw-r--r-- | intern/cycles/CMakeLists.txt | 9 |
1 files changed, 7 insertions, 2 deletions
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( |