travelping / upg-vpp

User Plane Gateway (UPG) based on VPP
Apache License 2.0
146 stars 51 forks source link

build: create compile_commands.json on build #370

Closed demo-exe closed 8 months ago

demo-exe commented 8 months ago

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 commented 8 months ago

what does it do?

demo-exe commented 8 months ago

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

mgumz commented 8 months ago

@demo-exe put this into the commit message.

mogaika commented 8 months ago

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

demo-exe commented 8 months ago

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 commented 8 months ago

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

mgumz commented 8 months ago

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

demo-exe commented 8 months ago

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