Skip to content

Commit

Permalink
fix: remove unsupported compiler flags for MSVC (opentibiabr#3173)
Browse files Browse the repository at this point in the history
Resolves warnings issued during the Windows build
process with MSVC caused by unsupported compiler flags `(-march, -mtune,
-mno-avx, and -mno-sse4)`.
  • Loading branch information
omarcopires authored and vllworldbuilding committed Dec 15, 2024
1 parent b83281e commit a19d948
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)

# Configure build options for compatibility with commodity CPUs
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -mtune=generic -mno-avx -mno-sse4")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=x86-64 -mtune=generic -mno-avx -mno-sse4")

if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -mtune=generic -mno-avx -mno-sse4")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=x86-64 -mtune=generic -mno-avx -mno-sse4")
endif()

# *****************************************************************************
# Include cmake tools
Expand Down

0 comments on commit a19d948

Please sign in to comment.