merge from Vc: simplify avx_sorthelper compilation by reusing vc_compile_for_all_impl...
authormkretz <mkretz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Nov 2013 15:13:12 +0000 (15:13 +0000)
committermkretz <mkretz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Nov 2013 15:13:12 +0000 (15:13 +0000)
this fixes a compliation error with clang for non-AVX targets

Vc/CMakeLists.txt

index d9b74de..8e1fce0 100644 (file)
@@ -6,25 +6,8 @@ string(REPLACE "-Weffc++" "" CXXFLAGS "${CXXFLAGS}")
 set(libvc_compile_flags "-DVC_COMPILE_LIB ${CXXFLAGS} -O3 ${Vc_DEFINITIONS}")
 vc_compile_for_all_implementations(_objs src/trigonometric.cpp FLAGS ${libvc_compile_flags}
       ONLY SSE2 SSE3 SSSE3 SSE4_1 AVX SSE+XOP+FMA4 AVX+XOP+FMA4)
+vc_compile_for_all_implementations(_objs src/avx_sorthelper.cpp FLAGS ${libvc_compile_flags} ONLY AVX)
 set(_srcs src/const.cpp src/cpuid.cpp src/support.cpp ${_objs})
-if(USE_AVX)
-   list(APPEND _srcs src/avx_sorthelper.cpp)
-else()
-   if(NOT Vc_AVX_INTRINSICS_BROKEN)
-      # we'd still like to have avx_sorthelper.cpp built in, but that requires compilation with -mavx (or a comparable flag)
-      foreach(_flag "-xAVX" "-mavx" "/arch:AVX")
-         AddCompilerFlag("${_flag}" CXX_RESULT _flag_works)
-         if(_flag_works)
-            if(_flag STREQUAL "-xAVX")
-               set(_flag "${_flag} -diag-disable 10121") # disable the warning "overriding -xSSE4.2 with -xAVX"
-            endif()
-            list(APPEND _srcs src/avx_sorthelper.cpp)
-            set_source_files_properties(src/avx_sorthelper.cpp PROPERTIES COMPILE_FLAGS "${_flag}")
-            break()
-         endif()
-      endforeach()
-   endif()
-endif()
 add_library(Vc STATIC ${_srcs})
 add_target_property(Vc COMPILE_FLAGS ${libvc_compile_flags})