[cfe-dev] Dependencies between tools

Alexander Kornienko via cfe-dev cfe-dev at lists.llvm.org
Mon May 14 09:47:12 PDT 2018


I also don't know much about CMake, but it looks like add_clang_library is
enough for libraries in the Clang tree. Apparently, it does something
specific to the clang tree layout (see `macro(add_clang_library ...`
in cmake/modules/AddClang.cmake, it refers to
${CLANG_SOURCE_DIR}/include/clang/${lib_path}/*.h). Maybe a similar macro
should be added for tools/extra to allow libraries to be exported in a
similar way.

On Mon, May 14, 2018 at 6:34 PM Chris Gray <chrismgray at google.com> wrote:

> What path should be used in the #include statement?  I'm no CMake expert,
> but I interpreted add_clang_library only to affect the linking behavior,
> not what headers are visible.
>
> On Mon, May 14, 2018 at 9:31 AM Alexander Kornienko <alexfh at google.com>
> wrote:
>
>> On Mon, Apr 23, 2018 at 11:10 AM Ilya Biryukov <ibiryukov at google.com>
>> wrote:
>>
>>> You're right, all of clang-extra-tools are not structured as libraries.
>>> I guess the most principled approach would to follow LLVM's convention and
>>> move public headers into include/, everything else to lib/, etc.
>>>
>>> +Alexander Kornienko <alexfh at google.com>, have you considered
>>> extracting a public library interface for clang-tidy before? Any ideas on
>>> how to do it properly?
>>>
>>
>> Clang-tidy has been used as a library since its appearance. But this was
>> done outside the official source tree. If there's interest in using it from
>> clangd, but something is missing in the appropriate CMake configs, we
>> should fix them. However, it looks
>> like tools/extra/clang-tidy/CMakeLists.txt already defines
>> `add_clang_library(clangTidy ...`, which should be enough?
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180514/e2cf1343/attachment.html>


More information about the cfe-dev mailing list