From a9f2641cb64c6e3bfd2d9b162f4ede4efc988244 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 19 Oct 2020 17:42:17 +0200 Subject: 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. --- intern/cycles/test/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'intern/cycles/test') 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}") -- cgit v1.2.3