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.
This commit is contained in:
Brecht Van Lommel 2020-10-19 17:42:17 +02:00
parent d1eefc4215
commit a9f2641cb6
1 changed files with 8 additions and 4 deletions

View File

@ -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}")