diff options
Diffstat (limited to 'intern/cycles/CMakeLists.txt')
-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( |