ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 2012-11-26 04:39:05 -0500

joq gravatar image

An ugly solution is to export the package A sources as C++ header files, which could be compiled in B as a separate library using the desired CFLAGS.

I can think of reasons not to do it that way. Some of them might be mitigated by placing the headers in an impl subdirectory, referenced like this:

#include <A/impl/lib_sources.hpp>
click to hide/show revision 2
suggest separate package for headers

An ugly solution is to export the package A sources as C++ header files, which could be compiled in B as a separate library using the desired CFLAGS.

I can think of reasons not to do it that way. Some of them might be mitigated by placing the headers in an impl subdirectory, referenced like this:

#include <A/impl/lib_sources.hpp>

If I were actually going to maintain some code this way, I might prefer creating a separate package for the header files which both A and B could use as needed.