Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8210459

Add support for generating compile_commands.json

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b15

      Backports

        Description

        A popular format for describing how to compile object files for a project is the JSON Compilation Database (a.k.a. compile_commands.json) [1]. This file can be used directly by IDEs such as Visual Studio Code and CLion as well as "language servers" such as cquery [2] and rtags [3].

        It's currently possible to use tools such as Bear [4] to generate this file for the JDK, but this requires a full build to complete before the information is available.

        However, it is possible to generate this information without actually compiling the files in question. This makes it possible to quickly obtain this information on freshly cloned source which can then be used by the tool of choice to start working immediately, without waiting for a full build.

        [1] https://clang.llvm.org/docs/JSONCompilationDatabase.html
        [2] https://github.com/cquery-project/cquery
        [3] https://github.com/Andersbakken/rtags
        [4] https://github.com/rizsotto/Bear

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                rwestberg Robin Westberg (Inactive)
                Reporter:
                rwestberg Robin Westberg (Inactive)
                Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: