From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-11-19 03:59:47
> What if you want to support cross-compilation? For example, I am
> developing a GUI library in the sandbox that is aiming to support
> Win32/64 API on Windows, Cocoa on MacOS, PalmOS API on PalmOS and X11,
> Motif/Lesstif and GTK+ on Linux as well as the possibility for others.
> The way I see it, I would need to define a feature, e.g. gui, and define
> it like this:
> feature gui
> win32 win64 cocoa palmos x11 motif gtk custom
> But then how do I add <define>s specific to the platform, e.g.:
> win32 --> <define>PLATF_WINDOWS <define>PLATF_WIN32
> cocoa --> <define>PLATF_MACOS <define>PLATF_COCOA
How about the very last code example at:
by replacing <library> with <define> and <parallelism> with <gui>, you should
get pretty close.
> If I were to say something like:
> exe guiapp : guiapp.cpp gui//libgui/<gui>win32 ;
> How can I ensure that
>  <define>PLATF_WINDOWS <define>PLATF_WIN32 are added for guiapp.cpp
> compilation; and
As above, I think.
>  <user-interface>gui is implied?
You would just add <user-interface>gui to expansion of <gui>win32.
> Also, would:
> exe guiapp : guiapp.cpp gui//libgui : <gui>win32 ;
> work as well as:
> exe guiapp : guiapp.cpp gui//libgui ;
> bjam release gcc-3.3 gui=win32
> bjam release cw-8.3 gui=palmos
I'd except yes.
However, we might take the time to implement the right support for
cross-compiling. So that you'd say:
bjam release gcc-3.3 os=NT
bjam release cw-83 os=palmos
Your Jamfiles would have conditions for all supportest OSes:
lib gui : .......... : <os>NT:<define>FOO <os>palmos:<define>BAR ;
The only problem I see if that we need to adjust the tools so that they
understand the <os> feature.
> SIDE NOTE: When I compile a GUI application (<user-interface>gui) in gcc
> using bjam, I get a console window as well as the GUI frame. Is there a
> way to remove the console window in this configuration?
I don't know. Do you have WinMain as entry point?
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk