diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-25 12:15:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-25 12:23:25 +0300 |
commit | cd9ebc816ece2ba7af95caa38cf3517131a9a361 (patch) | |
tree | 6504d843df665e1aa97fe768b6a72156e3b2f730 /intern | |
parent | 72fb92ded8e8e25c870c9bf26414d12cab385c83 (diff) |
Fix build error with WITH_CYCLES_KERNEL_NATIVE_ONLY on macOS Arm
-march=native is not supported for all architectures.
Diffstat (limited to 'intern')
-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( |