Closed oicu0619 closed 1 year ago
Yes, this is intended to filter out the linker flags. Since the JSON compilation database is for compilations only, linker flags will not influence the compilation pass of the compiler.
Does the generated output not working with Clang tooling programs? (clang-tidy
or clang-format
or with any other tool that you are planning to use the output with)
Thanks for the reply! Generated output works fine with Clang tooling programs.
Makefile:
LDFLAGS = -lpthread all: test
Actual compile commands (make VERBOSE=1):
g++ -lpthread test.cc -o test
compile_commands.json generated by bear:
[ { "arguments": [ "g++", "-c", "-o", "test", "test.cc" ], "directory": "/home/oicu/Downloads/cpp", "file": "test.cc" } ]
the flags in LDFLAGS is missing.