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

Liviu Prodea via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 5 12:36:11 PDT 2019

I kind of figured it out and scripted the targets picking solution myself but that 'LLVM_DISTRIBUTION_COMPONENTS' option is definitely better as it should work with both MsBuild and ninja. Too bad this isn't in the docs though:
https://llvm.org/docs/CMake.html#llvm-specific-variables   On Friday, April 5, 2019, 8:44:43 PM GMT+3, Chris Bieneman <chris.bieneman at me.com> wrote:  
 You don't actually need to change your CMake configuration to reduce the number of components you build. Just don't build the `all` target, instead build the components you need.
Alternatively you can set the CMake variable `LLVM_DISTRIBUTION_COMPONENTS` to the list of things you need, which will result in the generation of a `distribution` target which will build just those pieces.

On Mar 29, 2019, at 3:19 PM, Liviu Prodea via llvm-dev <llvm-dev at lists.llvm.org> wrote:
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
After reading
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. 
LLVM Developers mailing list
llvm-dev at lists.llvm.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190405/710ffba5/attachment.html>

More information about the llvm-dev mailing list