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

build: create compile_commands.json on build #370

Merged
merged 3 commits into from
Dec 21, 2023
Merged

Conversation

demo-exe
Copy link
Collaborator

@demo-exe demo-exe commented Dec 21, 2023

adding compile_commands.json to gitignore and creating it with cmake enables editors to use LSP.
You can now symlink it to build dir or copy/modify it in repo root.

@mgumz
Copy link

mgumz commented Dec 21, 2023

what does it do?

@demo-exe
Copy link
Collaborator Author

it allows clangd lsp to work - compile_commands is a list of clang calls basically.
compile_commands in root is ln -s to actual in build-root

@demo-exe demo-exe changed the title feat: create compile_commands.json on build build: create compile_commands.json on build Dec 21, 2023
@mgumz
Copy link

mgumz commented Dec 21, 2023

@demo-exe put this into the commit message.

@mogaika
Copy link
Collaborator

mogaika commented Dec 21, 2023

Isn't such compile_commands.json will contain global paths like -I/src/build-root -I/src/build-root/vpp_plugins/upf?

@demo-exe
Copy link
Collaborator Author

Depends on where you run cmake.
Anyway, the internet seems to have no better option for developing inside docker containers than to install editor inside it.

@demo-exe
Copy link
Collaborator Author

after some discussion, added the file to gitignore, this allows for more diverse setups like semi-local builds

@mgumz
Copy link

mgumz commented Dec 21, 2023

@demo-exe "fix" … fix what? Can you merge your "fix" into the appropriate commit

@demo-exe
Copy link
Collaborator Author

do not worry, in our flow everything gets squashed at merge :)

@demo-exe demo-exe merged commit ed8738b into master Dec 21, 2023
9 checks passed
@demo-exe demo-exe deleted the mzyla/clangdb branch December 21, 2023 14:45
@korroot korroot added the test label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants