/catkin-compile-commands

Generates compile_commands.json using catkin.

Primary LanguageNixGNU General Public License v3.0GPL-3.0

catkin-compile-commands

Copied from this issue. Generates compile-commands.json files using catkin and bash, used with language servers like clangd.

Prerequisites

  • jq
  • build-essentials on Debian-based, base-devel on Arch-based, or equivalent.
  • catkin

Installation

make install [PREFIX=/installation/directory]

Uninstallation

make uninstall [PREFIX=/installation/directory]

Nix Flake

nix build .

Usage

  • Build your packages using the flag -DCMAKE_EXPORT_COMPILE_COMMANDS=YES or put the following in CMakeLists.txt:
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
  • Create .extended_ws in workspace root
  • Put catkin workspaces to be source'd into .extended_ws, e.g. /opt/ros/noetics
  • In catkin root directory, run
catkin-compile-commands

Restart your language server if necessary.