...
Code Block |
---|
cmake ..\llvm-project\llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lldb;lld;llvm" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_C_FLAGS="-fms-compatibility-version=19.14" -DCMAKE_CXX_FLAGS="-fms-compatibility-version=19.14" -DCMAKE_TRY_COMPILE_CONFIGURATION=Release -DLLVM_DEFAULT_TARGET_TRIPLE="arm64-pc-windows-msvc" -G Ninja |
NoteSome specifics:
https://reviews.llvm.org/D92515 bumped llvm’s required MSVC version, ironically meaning that clang-cl version 12 can’t build it. That’s why we need the “
ms-compatibility-version
" flag to have clang-cl pretend to be a newer MSVC.
...
Known issue with cmake 3.21.1, it builds all try_compile/try_run as debug even if you select release mode. This is why we set “-DCMAKE_TRY_COMPILE_CONFIGURATION=Release”. Not doing so causes a try_run to fail to get error message strings, so lit defaults to Linux strings and a bunch of tests fail.
We set
LLVM_DEFAULT_TARGET_TRIPLE
manually because the prompt we use is an x86 32 bit host prompt. There is no arm64 to arm64 prompt, so cmake detects the host/default target triple “correctly” but it’s not what we really want.
Then build as usual with ninja.
...