Skip to content

Commit 0a76801

Browse files
committed
Move build system improvements
1 parent daf466a commit 0a76801

File tree

5 files changed

+30
-50
lines changed

5 files changed

+30
-50
lines changed

Jamroot.jam renamed to Jamroot

File renamed without changes.

libs/python/numpy/src/Jamfile

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import python ;
2-
import numpy ;
3-
2+
#import numpy ;
3+
import regex ;
44
using python ;
55

66
libraries = ;
77

8-
#How will the probe command be called ?
9-
108
if [ python.configured ]
119
{
1210

@@ -17,6 +15,20 @@ project boost/numpy
1715

1816
lib boost_python ;
1917

18+
rule numpy-includes ( properties * )
19+
{
20+
import feature ;
21+
local python-interpreter = [ feature.get-values python.interpreter : $(properties) ] ;
22+
if $(python-interpreter)
23+
{
24+
local full-cmd =
25+
$(python-interpreter)" -c \"from numpy.distutils import misc_util; print ':'.join(misc_util.get_numpy_include_dirs())\" " ;
26+
local output = [ SHELL $(full-cmd) ] ;
27+
local includes = [ regex.split $(output) ":" ] ;
28+
return <include>$(includes) ;
29+
}
30+
}
31+
2032
lib boost_numpy
2133
: # sources
2234
dtype.cpp
@@ -29,8 +41,11 @@ lib boost_numpy
2941
<library>/python//python_for_extensions
3042
#<library>/boost/python//boost_python
3143
<library>boost_python
44+
<conditional>@numpy-includes
3245
: # default build
3346
<link>shared
47+
: # usage requirements
48+
<conditional>@numpy-includes
3449
;
3550

3651
libraries += boost_numpy ;

libs/python/numpy/test/Jamfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
import numpy ;
2-
1+
import testing ;
2+
import python ;
33

44
use-project /boost/numpy : ../src ;
5-
project /boost/numpy/test
6-
: requirements
7-
# Why isn't this provided by 'using python' ?
8-
#<include>/usr/include/python2.7
9-
;
5+
project /boost/numpy/test ;
106

7+
rule numpy-test ( name : sources * : requirements * )
8+
{
9+
sources ?= $(name).py $(name)_mod.cpp ;
10+
return [ testing.make-test run-pyd : $(sources) /boost/numpy//boost_numpy
11+
: $(requirements) : $(name) ] ;
12+
}
1113

1214
test-suite numpy
1315
:
1416

15-
[ numpy.numpy-test templates ]
16-
[ numpy.numpy-test ufunc ]
17+
[ numpy-test templates ]
18+
[ numpy-test ufunc ]
1719

1820
;

numpy.jam

Lines changed: 0 additions & 23 deletions
This file was deleted.

patch

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)