[cfe-dev] Separating clang-tools-extra from clang in LLVM_ENABLE_PROJECTS

James Y Knight via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 14 12:49:09 PST 2019


I really don't understand what the intended purpose of clang-tools-extra
is. Why do I want to build clang-format, clang-fuzzer, clang-refactor, and
a bunch of other stuff by default, but not clang-query, clang-tidy, etc? I
cannot understand the distinction there.

On Wed, Feb 13, 2019 at 6:15 PM Reid Kleckner via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> The context is https://reviews.llvm.org/D58157
>
> Back when Mehdi originally introduced the LLVM_ENABLE_PROJECTS cmake
> variable, people were discussing the idea of folding clang-tools-extra into
> clang, if we moved to multiple git repos away from a monorepo. To support
> that goal, this code was added:
> https://github.com/llvm/llvm-project/blob/master/llvm/CMakeLists.txt#L144
>       # There is a widely spread opinion that clang-tools-extra should be
> merged
>       # into clang. The following simulates it by always enabling
> clang-tools-extra
>       # when enabling clang.
>       if (proj STREQUAL "clang")
>         set(LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR
> "${CMAKE_CURRENT_SOURCE_DIR}/../clang-tools-extra")
>       endif()
>
> This makes it so that if you're building clang, you're building
> clang-tidy, clangd, etc. However, we have use cases where we want to check
> out the monorepo and just build clang, so we wanted to remove that block.
>
> The upshot is that if you use LLVM_ENABLE_PROJECTS today and you want to
> build clang tools, you will have to add "clang-tools-extra" to your CMake
> invocation after D58157 lands. We've identified the one upstream buildbot
> that uses this variable and plan to update it, but if you have downstream
> bots using this variable, you may also need to add "clang-tools-extra" to
> build clang-tidy & co.
>
> We have some consensus that this is the direction we want to go in the
> code review from Sam Mccall, Shoaib, myself, and Nico, but please let us
> know if you think this is the wrong direction.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190214/f54ad463/attachment.html>


More information about the cfe-dev mailing list