Giter VIP home page Giter VIP logo

Comments (4)

bc-lee avatar bc-lee commented on September 26, 2024

In my opinion, consuming raw compile_commands.json generated by gn isn't feasible for tools like clangd, since gn dumps raw commands with all the flags used to build the target. I don't work at Google and therefore don't use Goma or RBE, but I encountered the same issue a long time ago and developed a solution to parse compile_commands.json and filter out flags unnecessary for consuming tools.

You can find my script here: https://gist.github.com/bc-lee/8707d1e62d14f8bb6bd30ef6e67f1625

The script modifies the compile_commands.json file by removing flags that clangd doesn't need. It's not perfect, but it works for me. At least it's much easier than maintaining a separate output folder to avoid using unnecessary flags with clangd.

Example usage:
$ gn gen --export-compile-commands out/out_dir && parse-compile-commands out/out_dir

from flutter.

matanlurey avatar matanlurey commented on September 26, 2024

Thanks @bc-lee, that certainly is an option, maybe even the best one.

I'll let the rest of the engine team weigh in, but I appreciate the contribution!

from flutter.

matanlurey avatar matanlurey commented on September 26, 2024

Duplicate of #147767, and closed by flutter/engine#53135.

from flutter.

github-actions avatar github-actions commented on September 26, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

from flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.