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

Export compile_commands.json #1099

Open
ZedThree opened this issue Mar 5, 2025 · 2 comments
Open

Export compile_commands.json #1099

ZedThree opened this issue Mar 5, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@ZedThree
Copy link

ZedThree commented Mar 5, 2025

Description

It would be lovely to automatically export a compile_commands.json file to the build directory. This would make it easy for other tools to pick up the compile flags.

Possible Solution

No response

Additional Information

This can be done with CMake with the CMAKE_EXPORT_COMPILE_COMMANDS option, or with bear more generically.

The file spec is pretty simple, just a JSON list, one element per file, with a few fields.

@ZedThree ZedThree added the enhancement New feature or request label Mar 5, 2025
@ivan-pi
Copy link
Member

ivan-pi commented Mar 7, 2025

Hey @ZedThree, there has been a discussion of this before (#960).

Would you be willing to supervise this feature in the GSoC project in case someone applies for it? The description can be found here: https://github.com/fortran-lang/webpage/wiki/GSoC-2025-Project-ideas#export-build-order-and-compile_commandsjson-fpm

@ZedThree
Copy link
Author

Ah, I did have a look in the issues, didn't check the discussions. Sure, I don't know anything about fpm's internals though. I think in principle it's not too difficult -- at some point you must have all the information required, it's just a matter of putting that into a JSON struct and dumping it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants