]> git.uio.no Git - u/mrichter/AliRoot.git/blob - Vc/CMakeLists.txt
Tree chaching implemented and update of merging of trees
[u/mrichter/AliRoot.git] / Vc / CMakeLists.txt
1 macro(vc_add_target_property _target _prop _value)
2    get_target_property(_oldprop "${_target}" ${_prop})
3    if(NOT _oldprop)
4       set_target_properties("${_target}" PROPERTIES ${_prop} "${_value}")
5    else(NOT _oldprop)
6       set_target_properties("${_target}" PROPERTIES ${_prop} "${_oldprop} ${_value}")
7    endif(NOT _oldprop)
8 endmacro()
9
10 include_directories("${Vc_INCLUDE_DIR}")
11
12 if(USE_AVX)
13    add_library(Vc STATIC src/vector.cpp src/cpuid.cpp src/support.cpp src/avx/sorthelper.cpp)
14 else()
15    set(_srcs src/vector.cpp src/cpuid.cpp src/support.cpp)
16
17    if(NOT Vc_AVX_INTRINSICS_BROKEN)
18       # we'd still like to have avx/sorthelper.cpp built in, but that requires compilation with -mavx (or a comparable flag)
19       foreach(_flag "-xAVX" "-mavx" "-arch:AVX")
20          check_cxx_compiler_flag("${_flag}" check_cxx_compiler_flag_${_flag})
21          if(check_cxx_compiler_flag_${_flag})
22             if(_flag STREQUAL "-xAVX")
23                set(_flag "${_flag} -diag-disable 10121") # disable the warning "overriding -xSSE4.2 with -xAVX"
24             endif()
25             set(_srcs ${_srcs} src/avx/sorthelper.cpp)
26             set_source_files_properties(src/avx/sorthelper.cpp PROPERTIES COMPILE_FLAGS "${_flag}")
27             break()
28          endif()
29       endforeach()
30    endif()
31    add_library(Vc STATIC ${_srcs})
32 endif()
33 string(REPLACE "-Weffc++" "" CXXFLAGS "${CXXFLAGS}")
34 vc_add_target_property(Vc COMPILE_FLAGS "-DVC_COMPILE_LIB ${CXXFLAGS} -O3 ${Vc_DEFINITIONS}")
35 vc_add_target_property(Vc LABELS "other")
36
37 # vim: ft=cmake sw=3 et