Boost logo

Boost-Build :

From: Alan Gutierrez (alan-jamboost_at_[hidden])
Date: 2004-12-27 04:27:01


* Vladimir Prus <ghost_at_[hidden]> [2004-12-27 03:58]:
>
> Hi Alan,
>
> > > 1) I'm going to try building a library that contains the
> > > platform specific source files, and somehow, switch on which
> > > libraries are included, based on compiler.
> >
> > Stuck. Found this documentation:
> >
> > http://www.boost.org/doc/html/bbv2/tutorial/conditions.html
> >
> > "Sometimes different variant of a target are so different,
> > that describing them using conditional requirements would
> > be hard. Imagine that a library has different sources on two
> > supported toolsets, and dummy implementation for all the other
> > toolset. We can express this situation using target alternatives:"
> >
> > lib demangler : dummy_demangler.cpp ;
> > lib demangler : demangler_gcc.cpp : <toolset>gcc ;
> > lib demangler : demangler_msvc.cpp : <toolset>msvc ;
> >
> > I've put this in my Jamfile.v2:
> >
> > lib libosui : src/dummy.cpp ;
> > lib libosui : src/dummy.cpp : <toolset>msvc ;
> > lib libosui : src/dummy.cpp : <toolset>gcc ;
> >
> > And on OS X I get:
> >
> >
> > /Users/alan/var/build/boost_1_32_0/tools/build/v2/build/feature.jam:431: in
> > feature.validate-value-string from module featureerror:
> > "msvc" is not a known value of feature <toolset>error: legal
> > values: "darwin"
>
> For now, just add

> using msvc ;
> using gcc ;

> to your user-config.jam. A better solution will arrive a bit later.

I feel back to doing something like:

if [ os.name ] in NT
{
# stuff..
}
else if [ os.name ] in MACOSX
{
# stuff..
}

Part of the problem is that eventually, UI wise, <toolset>gcc
won't tell me if I'm targeting PalmOS, X11, or GTK, which would
all use the gcc compiler. Neither would <user-interface>gui.

--
Alan Gutierrez - alan_at_[hidden]
 

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