Skip to content

Commit

Permalink
mlas: drop -mcpu if it has been set by toolchain
Browse files Browse the repository at this point in the history
Signed-off-by: Clément Péron <[email protected]>
  • Loading branch information
clementperon committed Jan 26, 2025
1 parent b57f3e8 commit 07a0389
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmake/onnxruntime_mlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ endif()

set(ONNXRUNTIME_MLAS_LIBS onnxruntime_mlas)

function(remove_mcpu_flags var_name)
set(_original "${${var_name}}")
string(REGEX REPLACE "-mcpu=[-a-zA-Z0-9_.^$*+?]*" "" _updated "${_original}")
if (NOT _original STREQUAL _updated)
message("Dropped -mcpu flags from ${var_name} updated to: ${_updated}")
set(${var_name} "${_updated}" PARENT_SCOPE)
endif()
endfunction()

# Remove -mcpu flags from ASM, C and CXX flags
remove_mcpu_flags(CMAKE_ASM_FLAGS)
remove_mcpu_flags(CMAKE_C_FLAGS)
remove_mcpu_flags(CMAKE_CXX_FLAGS)

#TODO: set MASM flags properly
function(setup_mlas_source_for_windows)

Expand Down

0 comments on commit 07a0389

Please sign in to comment.