Closed bergercookie closed 4 years ago
Is there a way to generate a compile_commands.json file for the ROS workspace
Yes, the feature was implemented in #69 and that change is available as of colcon-cmake
version 0.2.20 as referenced in that ticket. So you likely have an older version.
lots of warnings like the following:
You might want to try the CMake option --no-warn-unused-cli
(see https://cmake.org/cmake/help/latest/manual/cmake.1.html).
Assuming that using the latest released version will resolve your question I am going to close this ticket.
I see. I would expect the --cmake-args=-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON
to create a single compile_commands.json
file at the root of the build directory. This way I would be able to feed tools like Sourcetrail with that one file instead of all the individual JSON files generated.
I mean, it's not too hard on my end to just aggregate them into a single file, it would just be nice for colcon to do it for me in the first place.
Do you think this is a feature worth having in colcon
?
I could take a look in implementing it.
I mean, it's not too hard on my end to just aggregate them into a single file, it would just be nice for colcon to do it for me in the first place.
Aplologies, I misunderstood your answer. The PR you linked is doing exactly that. I think I have an outdated version of colcon then!
Hi there,
Is there a way to generate a compile_commands.json file for the ROS workspace that colcon is used for? I've tried passing
--cmake-args=-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON
but that seems to only generatecompile_commands
for very few of the packages in my workspace as well as lots of warnings like the following:I've also tried generating the compile_commands.json using Bear but that resulted in an empty compile_commands file.
Any pointers?