premake-core icon indicating copy to clipboard operation
premake-core copied to clipboard

Any possibility to get compile_commands.json out of the box?

Open krupitskas opened this issue 3 years ago • 4 comments

What's your question? Hey! Im new to premake, Im surprised that I can't easily find any info about compile_commands.json. I've only found a couple of links to 5-6 years old plugin to premake. My Sublime Text experience for C++ projects only possible with clangd, which requires compile_commands.json, so is it thing here? If it is, maybe write any docs in README.md, because it pretty major thing. If its not, why it isn't implemented? Time constraints?

krupitskas avatar Jan 18 '21 02:01 krupitskas

Hey @krupitskas.

I have a branch with a WIP implementation: https://github.com/tritao/premake-core/commit/64113fcb7657d3d2714221fe619d7b462d66d380

I haven't sent a PR yet because I got some issues with getting the test to work at the time, even after trying for a while.

@starkos @samsinsane Maybe one of you could take a look?

tritao avatar Jan 18 '21 14:01 tritao

If its not, why it isn't implemented? Time constraints?

As you can probably already tell, it is not supported. As for why, time is the single largest factor. We have also been taking a "module first" approach to these things. If you feel that this is a must have feature for Premake, feel free to create a module and if it gains traction in the community we can consider bringing it into core.

Maybe one of you could take a look?

It looked okay to me? But it's been awhile since I've added a new module with unit test support.

samsinsane avatar Jan 19 '21 08:01 samsinsane

@tritao any plans to update your PR?

krupitskas avatar Feb 14 '21 09:02 krupitskas

From the "old" module https://github.com/tarruda/premake-export-compile-commands I submit a PR with all fork improvement + mines: https://github.com/Jarod42/premake-export-compile-commands/tree/Improvements

Jarod42 avatar May 17 '21 12:05 Jarod42