Skip to content

[cmake] Set up llvm-ml as ASM_MASM tool in WinMsvc.cmake #104903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions llvm/cmake/platforms/WinMsvc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ set(CMAKE_C_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" CACHE FILEPATH "")
set(CMAKE_CXX_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" CACHE FILEPATH "")
set(CMAKE_LINKER "${LLVM_NATIVE_TOOLCHAIN}/bin/lld-link" CACHE FILEPATH "")
set(CMAKE_AR "${LLVM_NATIVE_TOOLCHAIN}/bin/llvm-lib" CACHE FILEPATH "")
set(CMAKE_ASM_MASM_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/llvm-ml" CACHE FILEPATH "")

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

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