ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

how to get gcc or g++ command when using "colcon build" in ros2?

asked 2018-08-20 05:07:24 -0500

lxbeyond gravatar image

in ros2 ardent version, I can get compile command by "set(CMAKE_VEBOSE_MAKEFILE TRUE)" in CmakeLists.txt, but I can't find these message in ros2 bouncy, anyone can help me ?

edit retag flag offensive close merge delete


You mean when you start the build? You can do something like: --cmake-args -CMAKE_VEBOSE_MAKEFILE=TRUE when launching colcon command line.

pokitoz gravatar image pokitoz  ( 2018-08-20 08:07:44 -0500 )edit

I think this is actually supposed to be "--cmake-args -DCMAKE_VEBOSE_MAKEFILE=TRUE"

mschickler gravatar image mschickler  ( 2020-06-19 14:10:05 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-08-20 11:01:25 -0500

Dirk Thomas gravatar image

If the CMake code hasn't changed I would expect colcon to behave the same as ament_tools (since it is basically invoking CMake and Make for you).

By default colcon doesn't show the output from stdout. Have you tried enabling the output as mentioned in the docs?

edit flag offensive delete link more

answered 2022-10-19 14:21:34 -0500

randy gravatar image

The referenced docs link in the prior answer is now broken.

I found a related article on enabling additional information and I was able to run colcon --log-level debug build to get some insight, which gave me some hints that the build system used is make for my project.

This let me cd build/<project_name> and VERBOSE=1 make to see the build commands.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-08-20 05:07:24 -0500

Seen: 866 times

Last updated: Oct 19 '22