Open Scoeerg opened 1 year ago
I just ran into the same problem, while following the same example codebase, if you are using the cpp_pubsub example from the documentation (I'm on ROS2 Humble, with WSL Ubuntu-22.04). However, I noticed that later in the tutorial it is shown that the build configuration files (both the CMakeLists.txt and the package.xml) are incomplete, and you're going to fill them in the tutorial. The compile_commands.json
gets generated after. I wonder why this doesn't raise an error, and my guess is that in the CMake file there's no executable specified at first, therefore the build skips it entirely.
Hi,
ISSUE: Neither
colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja
norcolcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
produce anyros2_ws/build/compile_commands.json
.on Ubuntu 20.04 LTS using ROS2 Foxy,
colcon version-check
:especially
colcon-cmake 0.2.27: up-to-date
withNeither
colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja
norcolcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
produce anyros2_ws/build/compile_commands.json
.Output of
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja
:Edit: https://github.com/colcon/colcon-cmake/issues/76#issuecomment-609472603 i.e.
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja --no-warn-unused-cli
produces the same result.Any suggestions?
Originally posted by @Scoeerg in https://github.com/colcon/colcon-cmake/issues/61#issuecomment-1563341169