nickdiego / compiledb

Tool for generating Clang's JSON Compilation Database files for make-based build systems.
GNU General Public License v3.0
1.38k stars 123 forks source link

Support for other compiler names #107

Open amacara1 opened 4 years ago

amacara1 commented 4 years ago

compilerdb seems to miss TI C compiler names like: cl6x and armcl. Would be great to extend cc_compile_regex from parser.py with these.

gr4yj3d1 commented 3 years ago

I would like to add emscriptens emcc and em++ here

Klaim commented 3 years ago

Ditto.

I'm using Emscripten and various clang verions in a project targeting iOS, WASM and desktop and using build2. As pointed in that build2 issue, there is a simple command to invoke compiledb to generate a compile_commands.json for working, for example, with Visual Studio Code's intellisense. However it doesnt work with Emscripten (the generated file doesn't contain include paths nor does it recognize emcc and em++).

My project have a bunch of source files specific to WASM so just generating the compile_commands.json file for other platform doesn't cover all cases I would like to work with. (though it's an ok workaround most of the time).

Support for these compiler names would help, I think it wouldn't be too hard because emcc/em++ are basically a layer over clang/clang++?

gr4yj3d1 commented 2 years ago

I'm not that familiar with the internals of compildb, maybe someone else can better comment on this. I think it might just be as easy as extending cc_compile_regex and cpp_compile_regexin parser.py. In my case r"^.*-?[gc]\+\+-?[0-9.]*$|^.*-?clang\+\+-?[0-9.]*$|^em\+\+$" did the trick.