mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 01:12:13 +00:00
Minor stylistic Boost Build quickbook.jam script changes.
[SVN r46941]
This commit is contained in:
@@ -113,6 +113,7 @@ import scanner ;
|
||||
import project ;
|
||||
import targets ;
|
||||
|
||||
|
||||
# The one and only QUICKBOOK type!
|
||||
type.register QUICKBOOK : qbk ;
|
||||
|
||||
@@ -121,15 +122,17 @@ type.register QUICKBOOK : qbk ;
|
||||
feature.feature <quickbook-binary> : : free ;
|
||||
feature.feature <quickbook-binary-dependencies> : : free dependency ;
|
||||
|
||||
|
||||
# quickbook-binary-generator handles generation of the QuickBook executable, by
|
||||
# marking it as a dependency for QuickBook docs.
|
||||
#
|
||||
# If the user supplied the QuickBook command that will be used.
|
||||
#
|
||||
# Otherwise we search some sensible places for the QuickBook sources and
|
||||
# compile from scratch using the default toolset.
|
||||
# Otherwise we search some sensible places for the QuickBook sources and compile
|
||||
# from scratch using the default toolset.
|
||||
#
|
||||
# As a last resort we rely on the shell to find 'quickbook'.
|
||||
#
|
||||
class quickbook-binary-generator : generator
|
||||
{
|
||||
import common modules path targets build-system ;
|
||||
@@ -181,8 +184,8 @@ class quickbook-binary-generator : generator
|
||||
local quickbook-main-target = [ targets.resolve-reference $(quickbook-dir) : $(project) ] ;
|
||||
|
||||
# The first element are actual targets, the second are
|
||||
# properties found in target-id. We don't care about these since
|
||||
# we've passed the id ourselves.
|
||||
# properties found in target-id. We do not care about these
|
||||
# since we have passed the id ourselves.
|
||||
quickbook-main-target =
|
||||
[ $(quickbook-main-target[1]).main-target quickbook ] ;
|
||||
|
||||
@@ -192,10 +195,9 @@ class quickbook-binary-generator : generator
|
||||
# Ignore usage-requirements returned as first element.
|
||||
quickbook-binary-dependencies = $(quickbook-binary-dependencies[2-]) ;
|
||||
|
||||
# Some toolsets generate extra targets (e.g. RSP).
|
||||
# We must mark all targets as dependencies for the project, but
|
||||
# we'll only use the EXE target for quickbook-to-boostbook
|
||||
# translation.
|
||||
# Some toolsets generate extra targets (e.g. RSP). We must mark
|
||||
# all targets as dependencies for the project, but we will only
|
||||
# use the EXE target for quickbook-to-boostbook translation.
|
||||
for local target in $(quickbook-binary-dependencies)
|
||||
{
|
||||
if [ $(target).type ] = EXE
|
||||
@@ -225,8 +227,8 @@ class quickbook-binary-generator : generator
|
||||
ECHO " or site-config.jam with the call" ;
|
||||
ECHO " using quickbook : /path/to/quickbook ;" ;
|
||||
|
||||
# As a last resort, search for 'quickbook' command in path.
|
||||
# Note that even if the 'quickbook' command is not found,
|
||||
# As a last resort, search for 'quickbook' command in path. Note
|
||||
# that even if the 'quickbook' command is not found,
|
||||
# get-invocation-command will still return 'quickbook' and might
|
||||
# generate an error while generating the virtual-target.
|
||||
|
||||
@@ -234,8 +236,8 @@ class quickbook-binary-generator : generator
|
||||
}
|
||||
}
|
||||
|
||||
# Add $(quickbook-binary-dependencies) as a dependency of the current project
|
||||
# and set it as the <quickbook-binary> feature for the
|
||||
# Add $(quickbook-binary-dependencies) as a dependency of the current
|
||||
# project and set it as the <quickbook-binary> feature for the
|
||||
# quickbook-to-boostbook rule, below.
|
||||
property-set = [ $(property-set).add-raw
|
||||
<dependency>$(quickbook-binary-dependencies)
|
||||
@@ -247,7 +249,9 @@ class quickbook-binary-generator : generator
|
||||
}
|
||||
}
|
||||
|
||||
# Define a scanner for tracking QBK include dependencies
|
||||
|
||||
# Define a scanner for tracking QBK include dependencies.
|
||||
#
|
||||
class qbk-scanner : common-scanner
|
||||
{
|
||||
rule pattern ( )
|
||||
@@ -258,10 +262,12 @@ class qbk-scanner : common-scanner
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scanner.register qbk-scanner : include ;
|
||||
|
||||
type.set-scanner QUICKBOOK : qbk-scanner ;
|
||||
|
||||
|
||||
# Initialization of toolset.
|
||||
#
|
||||
# Parameters:
|
||||
@@ -270,8 +276,9 @@ type.set-scanner QUICKBOOK : qbk-scanner ;
|
||||
# When command is not supplied toolset will search for QuickBook directory and
|
||||
# compile the executable from source. If that fails we still search the path for
|
||||
# 'quickbook'.
|
||||
#
|
||||
rule init (
|
||||
command ? # path to QuickBook executable.
|
||||
command ? # path to the QuickBook executable.
|
||||
)
|
||||
{
|
||||
if ! $(.initialized)
|
||||
@@ -281,13 +288,16 @@ rule init (
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
generators.register [ new quickbook-binary-generator quickbook.quickbook-to-boostbook : QUICKBOOK : XML ] ;
|
||||
|
||||
|
||||
# <quickbook-binary> shell command to run QuickBook
|
||||
# <quickbook-binary-dependencies> targets to build QuickBook from sources.
|
||||
toolset.flags quickbook.quickbook-to-boostbook QB-COMMAND <quickbook-binary> ;
|
||||
toolset.flags quickbook.quickbook-to-boostbook QB-DEPENDENCIES <quickbook-binary-dependencies> ;
|
||||
toolset.flags quickbook.quickbook-to-boostbook INCLUDES <include> ;
|
||||
toolset.flags quickbook.quickbook-to-boostbook QB-COMMAND <quickbook-binary> ;
|
||||
toolset.flags quickbook.quickbook-to-boostbook QB-DEPENDENCIES <quickbook-binary-dependencies> ;
|
||||
toolset.flags quickbook.quickbook-to-boostbook INCLUDES <include> ;
|
||||
|
||||
|
||||
rule quickbook-to-boostbook ( target : source : properties * )
|
||||
{
|
||||
@@ -296,13 +306,15 @@ rule quickbook-to-boostbook ( target : source : properties * )
|
||||
DEPENDS $(target) : [ on $(target) return $(QB-DEPENDENCIES) ] ;
|
||||
}
|
||||
|
||||
|
||||
actions quickbook-to-boostbook
|
||||
{
|
||||
"$(QB-COMMAND)" -I"$(INCLUDES)" --output-file=$(1) $(2)
|
||||
}
|
||||
|
||||
# Declare a main target to convert a quickbook source into a boostbook
|
||||
# XML file.
|
||||
|
||||
# Declare a main target to convert a quickbook source into a boostbook XML file.
|
||||
#
|
||||
rule to-boostbook ( target-name : sources * : requirements * : default-build * )
|
||||
{
|
||||
local project = [ project.current ] ;
|
||||
|
||||
Reference in New Issue
Block a user