From c70a3fec3e3b469e381279917deb79b786e6b821 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Fri, 24 Aug 2018 11:51:50 +0800 Subject: [PATCH] fix redefinition of argument machine --- cmake/configure.cmake | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 7e5d8a76217..e03e15bfc01 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -50,20 +50,14 @@ if(NOT WITH_PROFILER) endif(NOT WITH_PROFILER) if(NOT CMAKE_CROSSCOMPILING) - set(SIMD_FLAG) - if(WITH_AVX) - if (AVX512F_FOUND) - set(SIMD_FLAG "${SIMD_FLAG} ${AVX512F_FLAG}") - endif() - if (AVX2_FOUND) - set(SIMD_FLAG "${SIMD_FLAG} ${AVX2_FLAG}") - endif() - if (AVX_FOUND) - set(SIMD_FLAG "${SIMD_FLAG} ${AVX_FLAG}") - endif() - if (SSE3_FOUND) - set(SIMD_FLAG "${SIMD_FLAG} ${SSE3_FLAG}") - endif() + if(WITH_AVX AND AVX512F_FOUND) + set(SIMD_FLAG ${AVX512F_FLAG}) + elseif(WITH_AVX AND AVX2_FOUND) + set(SIMD_FLAG ${AVX2_FLAG}) + elseif(WITH_AVX AND AVX_FOUND) + set(SIMD_FLAG ${AVX_FLAG}) + elseif(SSE3_FOUND) + set(SIMD_FLAG ${SSE3_FLAG}) endif() endif() -- GitLab