From cd9ebc816ece2ba7af95caa38cf3517131a9a361 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 25 Jul 2022 11:15:24 +0200 Subject: Fix build error with WITH_CYCLES_KERNEL_NATIVE_ONLY on macOS Arm -march=native is not supported for all architectures. --- intern/cycles/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'intern') 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( -- cgit v1.2.3