Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile_commands.json #15434

Closed
nathanvercaemert opened this issue Dec 8, 2021 · 8 comments
Closed

compile_commands.json #15434

nathanvercaemert opened this issue Dec 8, 2021 · 8 comments

Comments

@nathanvercaemert
Copy link
Contributor

Makefile doesn't lend itself to generating compile_commands.json with bear. This would be to use a language server (ccls) with the repository. Is there a workaround for this? I dug up a post on Reddit, but it's a few years old and isn't quite perfect anymore.

@tzarc
Copy link
Member

tzarc commented Dec 8, 2021

qmk generate-compilation-database -kb <yourkb> -km <yourkeymap> should suffice, nowadays.

@nathanvercaemert
Copy link
Contributor Author

That's what I was looking for. Thanks for this. Do you know if it's referenced anywhere?

@tzarc
Copy link
Member

tzarc commented Dec 8, 2021

Yep, just not in an obvious position by the looks of it:

https://docs.qmk.fm/#/cli_commands?id=qmk-generate-compilation-database

@nathanvercaemert
Copy link
Contributor Author

Thanks. This will be helpful if I ever have to piece it together in the future. Thanks again for the help.

@nathanvercaemert
Copy link
Contributor Author

nathanvercaemert commented Dec 8, 2021

➜ qmk_firmware (master) ✗ qmk generate-compilation-database -kb ergodox_ez -km nathanvercaemert
usage: qmk [-h] [-V] [-v] [--datetime-fmt DATETIME_FMT]
           [--log-fmt LOG_FMT] [--log-file-fmt LOG_FILE_FMT]
           [--log-file-level {debug,info,warning,error,critical}]
           [--log-file LOG_FILE] [--color] [--no-color]
           [--unicode] [--no-unicode] [--interactive]
           [--config-file CONFIG_FILE]
           {config,clone,console,env,setup,c2json,cd,chibios-confmigrate,clean,compile,doctor,flash,generate-rgb-breathe-table,info,json2c,lint,list-keyboards,list-keymaps,list-layouts,new-keyboard,new-keymap}
           ...
qmk: error: argument {config,clone,console,env,setup,c2json,cd,chibios-confmigrate,clean,compile,doctor,flash,generate-rgb-breathe-table,info,json2c,lint,list-keyboards,list-keymaps,list-layouts,new-keyboard,new-keymap}: invalid choice: 'generate-compilation-database' (choose from 'config', 'clone', 'console', 'env', 'setup', 'bux', 'c2json', 'cd', 'cformat', 'chibios-confmigrate', 'clean', 'compile', 'docs', 'doctor', 'fileformat', 'flash', 'format-c', 'format-json', 'format-python', 'format-text', 'generate-api', 'generate-config-h', 'generate-dfu-header', 'generate-docs', 'generate-info-json', 'generate-keyboard-h', 'generate-layouts', 'generate-rgb-breathe-table', 'generate-rules-mk', 'generate-version-h', 'hello', 'info', 'json2c', 'lint', 'list-keyboards', 'list-keymaps', 'list-layouts', 'kle2json', 'multibuild', 'new-keyboard', 'new-keymap', 'pyformat', 'pytest')

Any suggestions?

@tzarc
Copy link
Member

tzarc commented Dec 8, 2021

Sounds like your repo is out of date, it was added to the repo on November 27th, this year.

@nathanvercaemert
Copy link
Contributor Author

I resolved this issue with help from #4855

I just needed to run:

bear -vvvv qmk compile

@nathanvercaemert
Copy link
Contributor Author

O wow, love how QMK is always being improved. Thanks for the help. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants