skipping tools when building LLVM with CMake
I had added the Polly project to my LLVM source tree. But I didn't want to build it this time. git-grep
of Polly showed only one mention in tools/CMakeLists.txt
:
add_llvm_external_project(polly)
Yet even after commenting out the line, build files were still being generated for Polly. It turns out the lines just below it had a role to play:
# Automatically add remaining sub-directories containing a 'CMakeLists.txt'
# file as external projects.
add_llvm_implicit_external_projects()
Convenient, but not good for us. Digging through the cmake files, I came up with this:
#add_llvm_external_project(polly)
ignore_llvm_tool_subdirectory(polly)
This applies generally to other tools/projects in the tools/
directory you don't want LLVM to pick up automatically during the build (eg. lldb).
HTH