[clang] 5233ad1 - Compilation Database: Point Bazel users to a solution

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 28 16:30:16 PST 2021


Author: Nathan Ridge
Date: 2021-11-28T19:30:06-05:00
New Revision: 5233ad17e77eb7b7697f2664dc5a588a30fe5eaf

URL: https://github.com/llvm/llvm-project/commit/5233ad17e77eb7b7697f2664dc5a588a30fe5eaf
DIFF: https://github.com/llvm/llvm-project/commit/5233ad17e77eb7b7697f2664dc5a588a30fe5eaf.diff

LOG: Compilation Database: Point Bazel users to a solution

This doc lists ways of getting compilation databases out of some popular build systems for use with clangd and other tooling.

We built such a way for Bazel and just released it after a bunch of requests on GitHub. Thought I should propose that we add a link to help people find it and use clang tooling.

(This is my first revision submitted via LLVM Phabricator, so if I've messed something up, I'd really appreciate your help and patience. Asking for a review from Sam McCall, because I've had a great time working with him elsewhere on GitHub before and because I saw him in the Git history for this file.)

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D114213

Added: 
    

Modified: 
    clang/docs/JSONCompilationDatabase.rst

Removed: 
    


################################################################################
diff  --git a/clang/docs/JSONCompilationDatabase.rst b/clang/docs/JSONCompilationDatabase.rst
index bd91db2583980..fd822c78d1fe9 100644
--- a/clang/docs/JSONCompilationDatabase.rst
+++ b/clang/docs/JSONCompilationDatabase.rst
@@ -36,6 +36,12 @@ works) with the option ``CMAKE_EXPORT_COMPILE_COMMANDS``.
 For projects on Linux, there is an alternative to intercept compiler
 calls with a tool called `Bear <https://github.com/rizsotto/Bear>`_.
 
+`Bazel <https://bazel.build>`_ can export a compilation database via 
+`this extractor extension 
+<https://github.com/hedronvision/bazel-compile-commands-extractor>`_.
+Bazel is otherwise resistant to Bear and other compiler-intercept
+techniques.
+
 Clang's tooling interface supports reading compilation databases; see
 the :doc:`LibTooling documentation <LibTooling>`. libclang and its
 python bindings also support this (since clang 3.2); see


        


More information about the cfe-commits mailing list