Giter VIP home page Giter VIP logo

Comments (4)

rizsotto avatar rizsotto commented on September 4, 2024

Thanks Jonathan for your report. The new version filters out all -MM? entries, because it is considered to do only the preprocess step of the compilation. It might be a wrong presumption... To fix your problem quickly, open the file 'bear' at line 350, and change the regex to r'^-E$'.

from bear.

jonthn avatar jonthn commented on September 4, 2024

Thanks for the quick feedback unfortunately the change you proposed doesn't solve my problem.

So for example with the current version of Bear I get this (even with change to the regex) :

    {
        "command": "cc -arch i386 -MMD -MP -fPIC -isystem /usr/include -I/tmp/myproject/include -DNDEBUG -o /tmp/myproject/src/my_file1.o -c  /tmp/myproject/src/my_file1.c", 
        "directory": "/tmp/myproject/src/", 
        "file": "/tmp/myproject/src/my_file1.c"
    }, 

and the output I'm looking for (MMD & MP as you said doesn't impact the compilation so I want to remove them) :

    {
        "command": "cc -arch i386 -fPIC -isystem /usr/include -I/tmp/myproject/include -DNDEBUG -o /tmp/myproject/src/my_file1.o -c  /tmp/myproject/src/my_file1.c", 
        "directory": "/tmp/myproject/src/", 
        "file": "/tmp/myproject/src/my_file1.c"
    }, 

from bear.

rizsotto avatar rizsotto commented on September 4, 2024

I see now. So, you want these compilation in the output, but you want those flags to get rid of. Bear does filtering the compiler invocations, but does not change the flags. How about if you run a post-processing step, which takes a compilation database as input and generate a new one, but modify the command line as you wish? And what if Bear does this post processing step? (I think that was you wanted originally.)
I will be away from keyboard for three months, but will come back to this topic.

from bear.

jonthn avatar jonthn commented on September 4, 2024

Yes I hoped that Bear would do this post processing but I indeed change how I invoke the compiler with a special argument to my Makefiles in order to omit those -MMD -MP flags which is not so much trouble because I only re-generate my database from time to time.

from bear.

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.