![]() |
Home | Libraries | People | FAQ | More |
Table of Contents
The simplest project that Boost.Build can construct is
stored in example/hello/
directory. The
project is described by a file
called Jamroot
that contains:
exe hello : hello.cpp ;
Even with this simple setup, you can do some interesting
things. First of all, just invoking bjam will
build the hello
executable by compiling and
linking hello.cpp
. By default, debug variant
is built. Now, to build the
release variant of hello
, invoke
bjam release
Note that debug and release variants are created in different
directories, so you can switch between variants or even build
multiple variants at once, without any unnecessary
recompilation. Let's extend the example by adding another line
to our project's Jamroot
:
exe hello2 : hello.cpp ;
Now let us build both the debug and release variants of our project again:
bjam debug release
Note that two variants of hello2
are linked.
Since we have already built both variants
of hello
, hello.cpp won't be recompiled;
instead the existing object files will just be linked into the
corresponding variants of hello2
. Now
let's remove all the built products:
bjam --clean debug release
It's also possible to build or clean specific targets. The
following two commands, respectively, build or clean only the
debug version of hello2
.
bjam hello2 bjam --clean hello2