Skip to content

Commit aeeb74f

Browse files
authored
[cmake] Set up llvm-ml as ASM_MASM tool in WinMsvc.cmake (#104903)
Nowadays, an ASM_MASM tool is required for building the BLAKE3 assembly in llvm/lib/Support - the llvm-ml tool can do this.
1 parent 2353f48 commit aeeb74f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/cmake/platforms/WinMsvc.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ set(CMAKE_C_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" CACHE FILEPATH "")
240240
set(CMAKE_CXX_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" CACHE FILEPATH "")
241241
set(CMAKE_LINKER "${LLVM_NATIVE_TOOLCHAIN}/bin/lld-link" CACHE FILEPATH "")
242242
set(CMAKE_AR "${LLVM_NATIVE_TOOLCHAIN}/bin/llvm-lib" CACHE FILEPATH "")
243+
set(CMAKE_ASM_MASM_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/llvm-ml" CACHE FILEPATH "")
243244

244245
# Even though we're cross-compiling, we need some native tools (e.g. llvm-tblgen), and those
245246
# native tools have to be built before we can start doing the cross-build. LLVM supports
@@ -275,6 +276,9 @@ endif()
275276
string(REPLACE ";" " " COMPILE_FLAGS "${COMPILE_FLAGS}")
276277
string(APPEND CMAKE_C_FLAGS_INIT " ${COMPILE_FLAGS}")
277278
string(APPEND CMAKE_CXX_FLAGS_INIT " ${COMPILE_FLAGS}")
279+
if(TRIPLE_ARCH STREQUAL "x86_64")
280+
string(APPEND CMAKE_ASM_MASM_FLAGS_INIT " -m64")
281+
endif()
278282

279283
set(LINK_FLAGS
280284
# Prevent CMake from attempting to invoke mt.exe. It only recognizes the slashed form and not the dashed form.

0 commit comments

Comments
 (0)