Skip to content

[native_toolchain_c] Generate compile_commands.json #2158

Open
@dcharkes

Description

@dcharkes

We should consider making this package generate compile_commands.json files.

https://clang.llvm.org/docs/ClangCommandLineReference.html#dependency-file-generation

I think we'd probably want to do this as a side effect of the hook, and only if the sources are not in the pub cache.

We need to do this as a side effect of the hook due to the following:

  1. The compiler can be passed in by the SDK, and
  2. Packages depended on can pass in include directories or libraries to be linked via metadata.

Hence, it is not enough to simply have a CBuilder and run it from a tool/generate_compile_commands_json.dart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestcontributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)package:native_toolchain_c

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions