[CMake] Multiple toolchains in one CMakeList?

John Spray john.c.spray at googlemail.com
Tue Feb 5 10:05:48 EST 2008


On Feb 5, 2008 2:52 PM, Joshua Jensen <jjensen at workspacewhiz.com> wrote:
>  I'll give a simple example, if I'm understanding the request.  For the PS3,
> you link SPU code in the PPU executable.  SPU code is just .c/.cpp files,
> possibly with libraries linked in.  In any case, there are two separate
> toolchains needed, one for PPU code and one for SPU code.

Yes, that's a good example.  In my case it's an in-house toolchain for
code which runs on a PCI device: a host program loads code onto the
device.  It's not the embedding that's the key thing, it's simply
being able to build two libraries in one invokation of make in a
dependency-aware fashion.  It might sound a bit perverse, but it's
necessary since the host code needs to know locations of certain
symbols in the device's code.

If I were invoking a second CMake, would I be able to make the host
CMake aware of the second as a dependency?  I have a feeling this
could get messy.  I guess an alternative approach would be to
implement a set of custom macros analogous to ADD_LIBRARY et al, which
are aware of another toolchain.

John


More information about the CMake mailing list