diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-10-19 18:42:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-10-19 18:55:00 +0300 |
commit | a9f2641cb64c6e3bfd2d9b162f4ede4efc988244 (patch) | |
tree | cf74c0a35dd55433c174d79d5649e66767747c5f /intern/cycles/test | |
parent | d1eefc421544e2ea632fb35cb6bcaade4c39ce6b (diff) |
Fix build error with WITH_CYCLES_NATIVE_ONLY and AVX tests on macOS
Only build avx/avx2 unit tests if supported by the compiler and
WITH_CYCLES_NATIVE_ONLY is off, otherwise the appropriate compiler flags
are not available.
Diffstat (limited to 'intern/cycles/test')
-rw-r--r-- | intern/cycles/test/CMakeLists.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/intern/cycles/test/CMakeLists.txt b/intern/cycles/test/CMakeLists.txt index 7d8f5916fef..cf8ebc2a1d9 100644 --- a/intern/cycles/test/CMakeLists.txt +++ b/intern/cycles/test/CMakeLists.txt @@ -51,13 +51,17 @@ set(SRC util_string_test.cpp util_task_test.cpp util_time_test.cpp - util_avxf_avx_test.cpp - util_avxf_avx2_test.cpp util_transform_test.cpp ) -set_source_files_properties(util_avxf_avx_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}") -set_source_files_properties(util_avxf_avx2_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}") +if(CXX_HAS_AVX) + list(APPEND SRC util_avxf_avx_test.cpp) + set_source_files_properties(util_avxf_avx_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}") +endif() +if(CXX_HAS_AVX2) + list(APPEND SRC util_avxf_avx2_test.cpp) + set_source_files_properties(util_avxf_avx2_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}") +endif() if(WITH_GTESTS) BLENDER_SRC_GTEST(cycles "${SRC}" "${ALL_CYCLES_LIBRARIES}") |