Fix build error with WITH_CYCLES_KERNEL_NATIVE_ONLY on macOS Arm

-march=native is not supported for all architectures.
This commit is contained in:
Brecht Van Lommel 2022-07-25 11:15:24 +02:00
parent 72fb92ded8
commit cd9ebc816e
1 changed files with 7 additions and 2 deletions

View File

@ -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(