compiler: cl
cmake-args: -G "Visual Studio 17 2022" -A x64 -T v143
+ - name: Windows MSVC 2022 v143 Win64 Native Instructions (AVX)
+ os: windows-latest
+ compiler: cl
+ cmake-args: -G "Visual Studio 17 2022" -A x64 -T v143 -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE=/arch:AVX
+
- name: Windows MSVC 2022 v142 Win32
os: windows-latest
compiler: cl
os: windows-latest
cmake-args: -T ClangCl -A x64
+ - name: Windows ClangCl Win64 Native Instructions (AVX)
+ os: windows-latest
+ cmake-args: -T ClangCl -A x64 -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul"
+
- name: Windows GCC
os: windows-latest
compiler: gcc
cmake-args: -G Ninja
codecov: win64_gcc
+ - name: Windows GCC Native Instructions (AVX)
+ os: windows-latest
+ compiler: gcc
+ cxx-compiler: g++
+ cmake-args: -G Ninja -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul"
+
- name: Windows GCC Compat No Opt
os: windows-latest
compiler: gcc
if(NOT WITH_RUNTIME_CPU_DETECTION)
if(MSVC AND BASEARCH_X86_FOUND)
message(STATUS "WARNING: Microsoft Visual Studio does not support compile time detection of CPU features for \"/arch\" before \"AVX\"")
+ # Workaround for MSVC. By default MSVC does not define the __SSE*__ macros.
+ # Fix it if AVX is enabled.
+ set(CMAKE_REQUIRED_FLAGS "${NATIVEFLAG}")
+ check_c_source_compiles(
+ "#ifndef __AVX__
+ # error \"AVX is not enabled.\"
+ #endif
+ int main(void) { return 0; }"
+ MSVC_IS_ENABLED_AVX
+ )
+ set(CMAKE_REQUIRED_FLAGS)
+ if(MSVC_IS_ENABLED_AVX)
+ add_definitions(
+ -D__SSE__=1
+ -D__SSE2__=1
+ -D__SSE3__=1
+ -D__SSSE3__=1
+ -D__SSE4_1__=1
+ -D__SSE4_2__=1
+ -D__PCLMUL__=1
+ )
+ endif()
endif()
add_definitions(-DDISABLE_RUNTIME_CPU_DETECTION)
endif()