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

Automating the generation of compile_commands.json #28

Closed
Compro-Prasad opened this issue Dec 23, 2018 · 1 comment
Closed

Automating the generation of compile_commands.json #28

Compro-Prasad opened this issue Dec 23, 2018 · 1 comment

Comments

@Compro-Prasad
Copy link

Doing this will help in getting started with LSP easily. A command to do this would be enough. I think this can be done with the help of projectile and/or project.el. By asking the user questions about the command to run to generate the compile_commands.json from project root.

@MaskRay
Copy link
Member

MaskRay commented Dec 23, 2018

compile_commands.json should not be generated automatically.

  • Where to put compile_commands.json: I usually prefer $project/Debug and for CMake-based projects I use cmake -H. -BDebug -DCMAKE_EXPORT_COMPILE_COMMANDS=YES <other options>. This operation creates some files that may not be wanted.
  • The various -D* options. They cannot be known beforehand.
  • compile_commands.json is not the only available choice: after the merge of Extend .ccls MaskRay/ccls#171 , .ccls can augment compile_commands.json
  • It is not straightforward to check the existence of compile_commands.json. I don't want to locate the project root with compile_commands.json (lots of other plugins do things like this) because:
proj
 Debug
  compile_commands.json
  generate.h        # this belongs to proj, not proj/Debug 
 compile_commands.json -> Debug/compile_commands.json

@MaskRay MaskRay closed this as completed Dec 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants