premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.17k stars 616 forks source link

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

Open krupitskas opened 3 years ago

krupitskas commented 3 years ago

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?

tritao commented 3 years ago

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?

samsinsane commented 3 years ago

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.

krupitskas commented 3 years ago

@tritao any plans to update your PR?

Jarod42 commented 3 years ago

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