Comments (4)
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.
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.
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.
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)
- Calling `bear -- emmake make` from makefile has different output than without the makefile HOT 3
- `bear intercept` prints empty events.json with dynamically linked arm-none-eabi-gcc HOT 3
- Compile option "--include <path>" generates incorrect database entry HOT 2
- compile asan, but the content of compile_commands.json is empty HOT 4
- makeopts ignored HOT 3
- can't install bear without sudo HOT 2
- has no member named ‘always_print_primitive_fields’ HOT 7
- How can I create the compile_commands.json for the Bear project? HOT 3
- Combining compile & link with Clang results in erroneous entry HOT 3
- Empty compilation database when compiling OpenBSD kernel HOT 2
- bear::func_test failed 7 tests (3.1.4) HOT 8
- [Build failed] ld cannot find stdc++fs: ld: undefined reference to std::filesystem HOT 4
- Question - how to capture built in compiler options HOT 1
- How to support emcc compiler? HOT 1
- bear 3.1.4 hangs when proxy is enabled in ubuntu 24.04 HOT 3
- I get the error: "ERROR: ld.so: object '/usr/$LIB/bear/libexec.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored." HOT 3
- Build2 compatibility HOT 5
- Cannot open /usr/local/bin/bear: No such file HOT 1
- Bear does not preserve single quotes in command line macro definitions HOT 2
- Build problem with fmtlib 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bear.