Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2006-04-16 22:44:10


Kostas Kostiadis wrote:
>
> Hello all,
>
>
>
> I've been using jam for a while, and as my project got bigger I
> decided to put together a proper build system from scratch...
>
> I decided to go with boost.build because I've heard a lot of good
> things about it...
>
> I've read the docs, the manual and had a look at the wiki, but there
> are some things I couldn't figure out how to do.
>
> I'm hoping you can help, so here comes:
>
>
>
> 1.
>
> Where can I get a list of all the possible options I can pass to
> certain things like "project" or "exe" (e.g. project can take :
> requirements, : usage-requirements, etc.)
>
"project" rule -
http://boost.org/boost-build2/doc/html/bbv2/advanced/projects.html
(unless you're talking about the build properties -- I don't know if
there's a list of those)

Main targets (like "exe" and "lib") -
http://boost.org/boost-build2/doc/html/bbv2/advanced/targets.html

> Is there a full reference table somewhere for all the things you can
> "import" and use or is my best bet just to go through the sources?
>
I don't know. I think it looks for whatever.jam in the v2
subdirectories, but I could be wrong.
>
>
>
> 2.
>
> What is the difference between <link>static and <link-runtime>static
>
<link> tells what kind of library to create: "<link>static"
creates/refers to statically linked (link-time) libraries and
"<link>shared" creates/refers to dynamically linked (at run-time) libraries.

<link-runtime> tells which version of the C run-time (CRT) lib to link
to. "<link-runtime>static" links the CRT in at link time, and
"<link-runtime>shared" links against the dynamic CRT (the DLL version on
Windows).
>
>
>
> 3.
>
> What is the difference between:
>
>
>
> project foo
>
> : usage-requirements <include>.
>
> : requirements <link>static
>
> ;
>
>
>
> exe foo
>
> : foo.cpp
>
> :
>
> ;
>
>
>
> AND
>
>
>
> project foo
>
> : usage-requirements <include>.
>
> ;
>
>
>
> exe foo
>
> : foo.cpp
>
> : <link>static
>
> ;
>
Nothing. The properties in the project get propagated to the targets in
the same file (and sub-projects, I believe). So, in the first one, you
could add "exe bar : bar.cpp ;" and it would have the "<link>static"
property as well.
>
>
> 4.
>
> Finally, where is the best place to define something like ROOT =
> $(HOME)/projects so that in my Jamfiles instead of doing things like
>
>
>
> use-project /math : ../../../libs/math
>
>
>
> I can instead do something like
>
>
>
> use-project /math : $(ROOT)/libs/math
>
>
That depends on how you have things laid out. In my setup, I have
Jamroot at the top of my source tree, with the projects in
sub-directories. Then, in Jamroot, I could do "path-constant ROOT : .
;" $(ROOT) would resolve to the directory containing Jamroot, relative
to the current directory. So, in $(HOME)/projects/foo/bar/Jamfile,
$(ROOT) would be "../.."

If everything is under $(HOME)/projects, though, a simpler way would be
to just do "use-project /math : libs/math ;" in $(HOME)/projects/Jamroot
(assuming the math lib is in $(HOME)/projects/libs/math).

Phillip


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