|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77763 - trunk/tools/build/v2/doc/src
From: steven_at_[hidden]
Date: 2012-04-04 14:52:52
Author: steven_watanabe
Date: 2012-04-04 14:52:51 EDT (Wed, 04 Apr 2012)
New Revision: 77763
URL: http://svn.boost.org/trac/boost/changeset/77763
Log:
Syntax highlighting in the tutorial.
Text files modified:
trunk/tools/build/v2/doc/src/tutorial.xml | 50 ++++++++++++++++++++--------------------
1 files changed, 25 insertions(+), 25 deletions(-)
Modified: trunk/tools/build/v2/doc/src/tutorial.xml
==============================================================================
--- trunk/tools/build/v2/doc/src/tutorial.xml (original)
+++ trunk/tools/build/v2/doc/src/tutorial.xml 2012-04-04 14:52:51 EDT (Wed, 04 Apr 2012)
@@ -30,7 +30,7 @@
<filename>example/hello/</filename> directory. The project is described by
a file called <filename>Jamroot</filename> that contains:
-<programlisting>
+<programlisting language="jam">
exe hello : hello.cpp ;
</programlisting>
@@ -49,7 +49,7 @@
once, without any unnecessary recompilation. Let us extend the example by
adding another line to our project's <filename>Jamroot</filename>:
-<programlisting>
+<programlisting language="jam">
exe hello2 : hello.cpp ;
</programlisting>
@@ -160,7 +160,7 @@
illustrates how these requirements might be specified.
</para>
-<programlisting>
+<programlisting language="jam">
exe hello
: hello.cpp
: <include>boost <threading>multi
@@ -203,7 +203,7 @@
Fortunately, there's a better way. Each project can specify a set of
<firstterm>attributes</firstterm>, including requirements:
-<programlisting>
+<programlisting language="jam">
project
: requirements <include>/home/ghost/Work/boost <threading>multi
;
@@ -272,7 +272,7 @@
any requirements specified by the subproject.
For example, if <filename>top/Jamroot</filename> has
-<programlisting>
+<programlisting language="jam">
<include>/home/ghost/local
</programlisting>
@@ -297,7 +297,7 @@
Jamfile explicitly requests it. In our example,
<filename>top/Jamroot</filename> might contain:
-<programlisting>
+<programlisting language="jam">
build-project app ;
</programlisting>
@@ -327,14 +327,14 @@
use libraries from <filename>top/util/foo</filename>. If
<filename>top/util/foo/Jamfile</filename> contains
-<programlisting>
+<programlisting language="jam">
lib bar : bar.cpp ;
</programlisting>
then to use this library in <filename>top/app/Jamfile</filename>, we can
write:
-<programlisting>
+<programlisting language="jam">
exe app : app.cpp ../util/foo//bar ;
</programlisting>
@@ -376,7 +376,7 @@
repeated for all programs that use <filename>foo</filename>. A better
solution is to modify <filename>util/foo/Jamfile</filename> in this way:
- <programlisting>
+ <programlisting language="jam">
project
: usage-requirements <include>.
;
@@ -398,7 +398,7 @@
code to <filename>Jamroot</filename>:
</para>
- <programlisting>
+ <programlisting language="jam">
use-project /library-example/foo : util/foo ;</programlisting>
<para>
@@ -425,7 +425,7 @@
requirements, like this:
</para>
- <programlisting>
+ <programlisting language="jam">
project
: requirements <library>/boost/filesystem//fs
;</programlisting>
@@ -451,7 +451,7 @@
command line:
<programlisting>b2 link=static</programlisting>
or in the library's requirements:
- <programlisting>lib l : l.cpp : <link>static ;</programlisting>
+ <programlisting language="jam">lib l : l.cpp : <link>static ;</programlisting>
</para>
<para>
@@ -470,7 +470,7 @@
VP: to be addressed when this section is moved. See comment below.
-->
- <programlisting>
+ <programlisting language="jam">
exe important : main.cpp helpers/<link>static ;</programlisting>
No matter what arguments are specified on the <command>b2</command>
@@ -485,7 +485,7 @@
that library is used by many targets, you <emphasis>could</emphasis> use
target references everywhere:
- <programlisting>
+ <programlisting language="jam">
exe e1 : e1.cpp /other_project//bar/<link>static ;
exe e10 : e10.cpp /other_project//bar/<link>static ;</programlisting>
@@ -515,7 +515,7 @@
<para>
When one library uses another, you put the second library in the source
list of the first. For example:
- <programlisting>
+ <programlisting language="jam">
lib utils : utils.cpp /boost/filesystem//fs ;
lib core : core.cpp utils ;
exe app : app.cpp core ;</programlisting>
@@ -554,14 +554,14 @@
<code>release</code> variant is built. This can be achieved using
<firstterm>conditional requirements</firstterm>.
- <programlisting>
+ <programlisting language="jam">
lib network : network.cpp
: <emphasis role="bold"><link>shared:<define>NEWORK_LIB_SHARED</emphasis>
<variant>release:<define>EXTRA_FAST
;</programlisting>
In the example above, whenever <filename>network</filename> is built with
- <code><link>shared</code>, <code><define>NEWORK_LIB_SHARED
+ <code language="jam"><link>shared</code>, <code language="jam"><define>NEWORK_LIB_SHARED
</code> will be in its properties, too. Also, whenever its release variant
is built, <code><define>EXTRA_FAST</code> will appear in its
properties.
@@ -573,15 +573,15 @@
library actually uses different source files depending on the toolset used
to build it. We can express this situation using <firstterm>target
alternatives</firstterm>:
- <programlisting>
+ <programlisting language="jam">
lib demangler : dummy_demangler.cpp ; # alternative 1
lib demangler : demangler_gcc.cpp : <toolset>gcc ; # alternative 2
lib demangler : demangler_msvc.cpp : <toolset>msvc ; # alternative 3</programlisting>
When building <filename>demangler</filename>, Boost.Build will compare
requirements for each alternative with build properties to find the best
- match. For example, when building with <code><toolset>gcc</code>
+ match. For example, when building with <code language="jam"><toolset>gcc</code>
alternative 2, will be selected, and when building with
- <code><toolset>msvc</code> alternative 3 will be selected. In all
+ <code language="jam"><toolset>msvc</code> alternative 3 will be selected. In all
other cases, the most generic alternative 1 will be built.
</para>
</section>
@@ -595,7 +595,7 @@
<varname>file</varname> property. Target alternatives can be used to
associate multiple library files with a single conceptual target. For
example:
- <programlisting>
+ <programlisting language="jam">
# util/lib2/Jamfile
lib lib2
:
@@ -617,7 +617,7 @@
Once a prebuilt target has been declared, it can be used just like any
other target:
- <programlisting>
+ <programlisting language="jam">
exe app : app.cpp ../util/lib2//lib2 ;</programlisting>
As with any target, the alternative selected depends on the properties
@@ -632,7 +632,7 @@
by searching through some set of predetermined paths—should be
declared almost like regular ones:
- <programlisting>
+ <programlisting language="jam">
lib pythonlib : : <name>python22 ;</programlisting>
We again don't specify any sources, but give a <varname>name</varname>
@@ -645,12 +645,12 @@
<para>
We can also specify where the toolset should look for the library:
- <programlisting>
+ <programlisting language="jam">
lib pythonlib : : <name>python22 <search>/opt/lib ;</programlisting>
And, of course, target alternatives can be used in the usual way:
- <programlisting>
+ <programlisting language="jam">
lib pythonlib : : <name>python22 <variant>release ;
lib pythonlib : : <name>python22_d <variant>debug ;</programlisting>
</para>
Boost-Commit 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