Closed fred-apex-ai closed 3 years ago
I was surprised to notice that in a plain
colcon build --packages-select foo
, it defaults to unix makefiles and doesn't set the build type.
The reason is that this is the default behavior of CMake. colcon
doesn't try to change reasonable defaults since that would surprise users familiar with the native tools.
You could put this configuration option into the defaults.yaml file if you prefer a custom default value.
I will go ahead and close the ticket assuming my previous comment answered your question.
I think the fact that release mode can only be specified with -DCMAKE_BUILD_TYPE=Release should be documented somewhere besides this one github issue. If you try googling colcon build release mode
you'll see what I mean. Perhaps put this information on the ros2 tutorial page? https://docs.ros.org/en/humble/Tutorials.html
Hey there, I was surprised to notice that in a plain
colcon build --packages-select foo
, it defaults to unix makefiles and doesn't set the build type. That is, in the build directory,and the compiler invocation has no optimization flags in it; e.g.
I'm aware that the build type is ignored when generating multiconfigurations for IDEs and the potential confusion about that; see https://stackoverflow.com/a/24470998/14409577
I also know how to opt in to build in release mode with
But I would expect that a C++ robotics package by default is built in release mode because performance matters. After all, why do we use C++?
Was this is discussed before and there are arguments that I'm missing?
fyi @nnmm