Skip to content

Commit

Permalink
use /arch:AVX2 for MSVC when USE_NATIVE_ARCH is on
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeoliphant committed Feb 20, 2025
1 parent fcb5963 commit b4144b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)")
option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF)

if (USE_NATIVE_ARCH)
add_compile_options(-march=x86-64-v3)
message("Enabling -march=x86-64-v3")
if (MSVC)
add_compile_options(/arch:AVX2)
message(STATUS "Enabling /arch:AVX2")

else()
add_compile_options(-march=x86-64-v3)
message(STATUS "Enabling -march=x86-64-v3")
endif()
endif (USE_NATIVE_ARCH)
endif ()

Expand Down

0 comments on commit b4144b9

Please sign in to comment.