3030 ;
3131}
3232
33- project boost/python
33+ project
3434 : source-location ../src
3535 ;
3636
3737rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } }
3838rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } }
3939local rule eq ( a : b ) { if $(a) = $(b) { return 1 ; } }
4040
41+ rule tag ( name : type ? : property-set )
42+ {
43+ if python-tag in [ RULENAMES $(__name__) ]
44+ {
45+ return [ $(__name__).python-tag $(name) : $(type) : $(property-set) ] ;
46+ }
47+ }
48+
49+ if [ python.configured ]
50+ {
51+
4152lib boost_python
4253 : # sources
4354 list.cpp
@@ -92,8 +103,8 @@ lib boost_python
92103 [ unless [ python.configured ] : <build>no ]
93104 <dependency>config-warning
94105 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
95- -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE) .tag
96- <tag>@python- tag
106+ -<tag>@%boostcpp .tag
107+ <tag>@tag
97108 <conditional>@python.require-py
98109
99110 : # default build
@@ -103,6 +114,17 @@ lib boost_python
103114 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
104115 ;
105116
117+ }
118+ else
119+ {
120+
121+ alias boost_python : config-warning ;
122+
123+ }
124+
125+ if [ python.configured ] && [ python.numpy ]
126+ {
127+
106128numpy-include = [ python.numpy-include ] ;
107129lib boost_numpy
108130 : # sources
@@ -120,8 +142,8 @@ lib boost_numpy
120142 <library>/python//numpy
121143 <library>boost_python
122144 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
123- -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE) .tag
124- <tag>@python- tag
145+ -<tag>@%boostcpp .tag
146+ <tag>@tag
125147 <conditional>@python.require-py
126148
127149 : # default build
@@ -131,37 +153,10 @@ lib boost_numpy
131153 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
132154 ;
133155
134- # boost-install creates `stage` and `install` targets
135- #
136- # `stage` stages (builds and copies into `stage/lib`) the given libraries
137- # `boost_python` and `boost_numpy` and their dependencies and is similar
138- # to issuing `b2 --with-python stage` from top level
139- #
140- # `install` installs the two libraries and their dependencies and is similar
141- # to issuing `b2 --with-python install` from top level
142-
143- if [ python.configured ]
144- {
145- if [ python.numpy ]
146- {
147- boost-install boost_python boost_numpy ;
148- }
149- else
150- {
151- boost-install boost_python ;
152- }
153156}
154157else
155158{
156159
157- # When Python isn't configured, the above `boost-install` is not executed,
158- # so we create empty `stage` and `install` targets that do nothing but issue
159- # a warning message unless `--without-python` is given
160-
161- alias stage : config-warning ;
162- explicit stage ;
163-
164- alias install : config-warning ;
165- explicit install ;
160+ alias boost_numpy : config-warning ;
166161
167162}
0 commit comments