[llvm-dev] [RFC] [CMake] Removing support for LLVM_TOOL_<PROJECT> CMake cache variables

Diana Picus via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 5 02:11:49 PST 2019

On Tue, 5 Feb 2019 at 10:59, Dan Liew via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hi,
> In our CMake build system there are currently two ways of specifying
> which LLVM sub projects to build by setting CMake cache variables.
> * Setting `LLVM_ENABLE_PROJECTS` to the list of projects to enable
> (e.g. `-DLLVM_ENABLE_PROJECTS=clang;compiler-rt`)
> * Setting `LLVM_TOOL_<PROJECT>_BUILD` boolean CMake cache variables
> Having two different ways of specifying the same thing is problematic
> because from the CMake perspective because we can't detect which way
> the user actually wants to use.
> Since r353148 if `LLVM_ENABLE_PROJECTS` is set by the user then that
> is used to determine which projects are built and any user specified
> value for the `LLVM_TOOL_<PROJECT>_BUILD` variables get overridden.
> `LLVM_ENABLE_PROJECTS`  currently only works with the new mono-repo
> layout (projects outside of the LLVM source tree) which basically
> means that:
> * `LLVM_ENABLE_PROJECTS` is used for the mono repo project layout
> *  `LLVM_TOOL_<PROJECT>_BUILD`  is used for the traditional in-tree
> project layout (e.g. projects located at `tools/clang`, `tools/lldb`,
> `projects/compiler-rt`).
> This is a bit of a mess and I'd like to propose we switch to only
> using  `LLVM_ENABLE_PROJECTS` and remove support for
> `LLVM_TOOL_<PROJECT>_BUILD` variables.
> I see two ways of doing this:
> * Graceful. We'll eventually move everyone over to the mono repo
> layout anyway so just drop support for `LLVM_TOOL_<PROJECT>_BUILD`
> variables as part of the process of removing support for the in-tree
> subprojects inside the LLVM source tree. We just need to document this
> change clearly.
> * Aggressive. Remove support for setting `LLVM_TOOL_<PROJECT>_BUILD`
> variables and only use `LLVM_ENABLE_PROJECTS`. The logic for
> `LLVM_ENABLE_PROJECTS` would need to be changed to work with in-tree
> subprojects.
> I'd prefer Graceful because it's less work and I actually have old
> scripts that rely on setting `LLVM_TOOL_<PROJECT>_BUILD` variables.
> Others might too.

+1, we also have old scripts that we're currently migrating to the
monorepo layout, but it's nobody's top priority and we'd appreciate it
if we could take our time.

> Thoughts?
> Thanks,
> Dan.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

More information about the llvm-dev mailing list