|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-02-13 04:03:15
Hi Reece,
> There has been some discussion about using pre-built libraries with
> Boost.Build and was wondering if it would be possible to implement an
> "import" feature that imports libraries from one or more directories,
> declaring them as targets.
>
> Let's call the feature "importlib" for lack of a better term. The jam file
> would set a library extension filter to select what libraries to import:
> filter : .lib ; # Win32; cygwin+gcc
> filter : .a ; # gcc; Linux?
>
> On an importlib target, e.g.
> importlib cygwinlib : /libs /usr/local/libs ;
> apply something like (I am only vaguely familiar with the way Boost.Build
> works):
> for file in $directory
> {
> if( $(file) has-extension $(filter) )
> {
> alias strip-extension( $(file) ) : : $(file) ;
> }
> }
I actually keep on wondering if we went to far with prebuilt targets. Why
don't we allow
exe main : main.cpp /usr/lib/somelibrary.a
: <find-library>z <library-path>/opt ;
to work? I fact, only <find-library> does not work at the moment. If a person
wants additional flexibility, he can rewrite it as:
alias some : /usr/lib/somelibrary.a ;
lib z : : <name>z <search>/opt ;
exe main : main.cpp some z ;
This would lift the need to declare all windows SDK libraries -- and would not
complicate the system at all.
OTOH, the feature you propose can be usefull in yet another context. Suppose
I've built three variants of a library with Boost.Build. Then I want to
remove the source and leave only "bin" directory. It would be nice to
automatically declarate all alternatives.
E.g. if there's
bin/gcc/debug/foo.so
bin/gcc/release/foo.so
to have automatically declared this:
alias foo : bin/gcc/debug/foo.so : <toolset>gcc <variant>debug ;
alias foo : bin/gcc/release/foo.so : <toolset>gcc <variant>release ;
I'm thinking that the best approach is to support the simplified use of
prebuilt libraries I've given below and then wait if auto-declaring is
demanded by users.
What do you think?
- Volodya
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