]>
Commit | Line | Data |
---|---|---|
c017a39f | 1 | include("${Vc_CMAKE_MODULES_DIR}/AddTargetProperty.cmake") |
f22341db | 2 | |
7c616f25 | 3 | include_directories("${Vc_INCLUDE_DIR}") |
f22341db | 4 | |
c017a39f | 5 | string(REPLACE "-Weffc++" "" CXXFLAGS "${CXXFLAGS}") |
6 | set(libvc_compile_flags "-DVC_COMPILE_LIB ${CXXFLAGS} -O3 ${Vc_DEFINITIONS}") | |
7 | vc_compile_for_all_implementations(_objs src/trigonometric.cpp FLAGS ${libvc_compile_flags} | |
8 | ONLY SSE2 SSE3 SSSE3 SSE4_1 AVX SSE+XOP+FMA4 AVX+XOP+FMA4) | |
9 | set(_srcs src/const.cpp src/cpuid.cpp src/support.cpp ${_objs}) | |
f22341db | 10 | if(USE_AVX) |
c017a39f | 11 | list(APPEND _srcs src/avx_sorthelper.cpp) |
f22341db | 12 | else() |
f22341db | 13 | if(NOT Vc_AVX_INTRINSICS_BROKEN) |
c017a39f | 14 | # we'd still like to have avx_sorthelper.cpp built in, but that requires compilation with -mavx (or a comparable flag) |
15 | foreach(_flag "-xAVX" "-mavx" "/arch:AVX") | |
16 | AddCompilerFlag("${_flag}" CXX_RESULT _flag_works) | |
17 | if(_flag_works) | |
f22341db | 18 | if(_flag STREQUAL "-xAVX") |
19 | set(_flag "${_flag} -diag-disable 10121") # disable the warning "overriding -xSSE4.2 with -xAVX" | |
20 | endif() | |
c017a39f | 21 | list(APPEND _srcs src/avx_sorthelper.cpp) |
22 | set_source_files_properties(src/avx_sorthelper.cpp PROPERTIES COMPILE_FLAGS "${_flag}") | |
f22341db | 23 | break() |
24 | endif() | |
25 | endforeach() | |
26 | endif() | |
f22341db | 27 | endif() |
c017a39f | 28 | add_library(Vc STATIC ${_srcs}) |
29 | add_target_property(Vc COMPILE_FLAGS ${libvc_compile_flags}) | |
f22341db | 30 | |
31 | # vim: ft=cmake sw=3 et |