How to add additional compile flags
For the ARM build of the PCL_ROS package to work I need to add some additional compiler (gcc / g++) flags. What is the right way to do it?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
For the ARM build of the PCL_ROS package to work I need to add some additional compiler (gcc / g++) flags. What is the right way to do it?
See the rosbuild/CmakeLists docs.
In particular, the rosbuild_add_compile_flags
and rosbuild_remove_compile_flags
macros are likely what you want.
$ROS_ROOT/core/rosbuild/rosconfig.cmake is where ros configuration starts. There are three places ros looks for rosconfig.cmake, and if you parse rosbuild's rosconfig.cmake, you'll find it essentially does the following:
If neither of the above are found, or not all configuration variables are set:
If you're cross compiling and want to add cpu specific flags globally, you may want to use eric's suggestion and include them in $ROS_ROOT/rosconfig.cmake. This is neater as it is under your control and avoids hacking someone else's CMakeLists.txt files (which will disappear next time you install).
If you need it for a certain package only, then that would be the only way to go, though I'd suggest finding a way to upstream the changes so others can benefit as well.
Asked: 2011-02-23 08:40:29 -0500
Seen: 4,441 times
Last updated: Feb 23 '11
Freenect_launch does not detect Kinect, BeagleBoard-xM, Ubuntu [closed]
CMake Error in Netbeans (double-check your ROS_PACKAGE_PATH)
How to get boost libraries to link in cross compile?
Unable to move the robotic arm attached to turtlebot3 waffle
How to enter compiler flags into CMakeLists
undefined reference to a static library
Catkin_make optimization flags
yaml.load() is deprecated when source melodic_ws/setup.bash is executed.