From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-10-14 03:52:22
Toon Knapen wrote:
> Vladimir Prus wrote:
> > I've just made a final (I hope) tweak to the "lib" rule. Now it's
> > possible to do
> > lib png : z : <name>png ;
> > lib z : : <name>z ;
> > or
> > lib png : z : <file>png.a ;
> > lib z : : <file>z.a ;
> > and if you link to 'png', the 'z' library will be picked up too.
> > Previously, this required non-intuitive syntax.
> What if one uses <file> and <name>?
This is not allowed. For specifying search paths one should use the <search>
feature. Docs updated.
> Would'nt it be more consistent to
> have <path> and <name>. This way there is no overlap between the two
> properties. The <path> only needs to be used if the library is not in
> the default path and than will be passed as a -L option.
I think the slight difference is that <file> is very specific: it gives a file
and it will be linked to. For <name> + <search>, the name of the library
should be in a specific format. Besides, if you have library of the same name
in two directories, which one is picked is not defined (even by compiler).
lib a : : <variant>release <file>/pool/release/a.so ;
lib a : : <variant>debug <file>/pool/debug/a.so ;
lib b : : <variant>release <file>/pool/release/b.so ;
lib b : : <variant>debug <file>/pool/debug/b.so ;
With this setup, you can link to release version of a and debug version of b.
If you use <name>+<search>, then either release directory or debug one will
be first on the command line. Oops!
> > Finally, I've expanded the documentation on libraries (and other builtin
> > rules):
> > http://boost.org/boost-build2/doc/html/bbv2.advanced.builtins.targets.htm
> In the first example on that page:
> exe hello : hello.cpp some_library.lib /some_project//library
> : <threading>multi
> using 'some_library.lib' suggest to me that for library dependencies,
> one needs to specify the real name of the library (with the file-name
> extension which is '.lib' on windows) instead of the target-name
> corresponding to the library.
I've changed the text after example to be:
This will create an executable file from the sources -- in this case,
one C++ file, one library file present in the same directory, and
another library which is created by Boost.Build. Generally, sources
can include C and C++ files, object files and libraries. Boost.Build
will automatically try to convert targets of other types.
> Anyway the documentation is really improving!!! Keep up the good work!!!
Thanks. My current plan is to finish (kind of) the "extender manual" and
rearrange the reference section which is completely unstructured mess at the
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