[llvm-dev] How to build only the necessary components with MSVC

Liviu Prodea via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 29 15:19:28 PDT 2019


I configure LLVM build with this command
cd llvm-8.0.0.src & md buildsys-x64-MT & cd buildsys-x64-MT & cmake -G "Ninja" -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_INSTALL_PREFIX=../x64-MT ..
The number of build objects grew with every major release to 1660 for LLVM 7 and 1761 for LLVM 8.

I only need the components requested here
https://gitlab.freedesktop.org/mesa/mesa/blob/master/scons/llvm.py#L103
After reading
https://llvm.org/devmtg/2015-04/slides/eurollvm-2015-build.pdf
and
https://llvm.org/docs/CMake.html
I found these options to be relevant: LLVM_DYLIB_COMPONENTS, LLVM_BUILD_LLVM_DYLIB, LLVM_LINK_LLVM_DYLIB, LLVM_BUILD_TOOLS and LLVM_INCLUDE_TOOLS. Unfortunately LLVM_DYLIB_COMPONENTS depends on LLVM_BUILD_LLVM_DYLIB which doesn't support MSVC, I can turn off LLVM_BUILD_TOOLS and LLVM_INCLUDE_TOOLS if I figure out how to filter unneeded components as I would no longer need llvm-config anymore. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190329/60313633/attachment.html>


More information about the llvm-dev mailing list