Ask Your Question
0

Add compilation flags to rosdistro

asked 2019-09-03 23:17:33 -0500

I am trying to add a c++ library to rosdistro.
This project has lots of building definitions which you can modify with the cmake command, i.e. cmake ../ -DBUILD_EXAMPLES=true or cmake ../ -DBUILD_EXAMPLES=false.

I used bloom-release to create a PR for rosdistro:

However, for the ros buildfarm to successfully build the package I need to set a few definitions, such as BUILD_EXAMPLES=false.

The ROS preferred solution is to change the default definitions of the package. This, unfortunately, is not possible. For once, the default definitions reflect a common usage and cannot be changed. Another reason is that different definitions may be required for different platforms - different definitions for Ubuntu 16 and Ubuntu 18, etc.
So far, I created a fork with the default definitions modified but that is not a maintainable solution.

Is it possible to set compilation definitions for the ros buildfarm? Somewhere in the rosdistro's kinetic/distribution.yaml file maybe?
Is it possible to define different definitions for different platforms?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-09-04 02:32:01 -0500

gvdhoorn gravatar image

updated 2019-09-04 02:47:15 -0500

From your description I have the impression this library is not a ROS package.

A release would then mean doing a Bloom 3rd party release, which supports adding ROS-release specific patches. I've linked to the first section about patches (adding an install rule + manifest), but the same mechanism can be used for arbitrary other patches.

Using a patch you should be able to change the CMakeLists.txt and update the default values for the options you refer to.

I'm not sure it's possible to update the actual command that gets used by the buildfarm to build the package, but changing the defaults for the CMake options would seem to be a good alternative.


Edit: just remembered there is actually direct support for changing the build command used: Changing the build flags for a package.

To release a non-ROS (actually: Catkin) package though, you'd still need to do a 3rd party release, so I've left the first part of my answer above.

To answer your specific questions:

Is it possible to set compilation definitions for the ros buildfarm? Somewhere in the rosdistro's kinetic/distribution.yaml file maybe?

It should be clear now that you don't configure those flags in distribution.yaml, but they are part of the build configuration stored in your release repository.

Is it possible to define different definitions for different platforms?

Yes. Just make sure to checkout the correct branch in your release repository if changing the flags directly or when setting up the patches for a release.

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

1 follower

Stats

Asked: 2019-09-03 23:17:33 -0500

Seen: 12 times

Last updated: Sep 04