-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjamroot.jam
86 lines (62 loc) · 2.29 KB
/
jamroot.jam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import errors ;
import feature ;
import modules ;
import os ;
import python ;
import regex ;
import toolset ;
BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
if ! $(BOOST_ROOT)
{
import errors ;
errors.user-error : "Environment variable BOOST_ROOT not set." ;
}
# Configure python
if ! [ python.configured ]
{
local location = [ errors.nearest-user-location ] ;
echo info at $(location): Python module not configured in 'user-config.jam'. Try 'using python ;'... ;
using python ;
}
# Detect Python site-packages directory
local target-os = [ feature.get-values target-os ] ;
target-os ?= [ feature.defaults target-os ] ;
target-os = $(target-os:G=) ;
local toolset-requirements = [ toolset.requirements ] ;
local python-requirements = [ $(toolset-requirements).get <python> ] ;
local parsed-python-requirements = [ regex.match "^([0-9]+)\\.([0-9]+),(.+)$" : $(python-requirements) ] ;
local python-major = $(parsed-python-requirements[1]) ;
local python-minor = $(parsed-python-requirements[2]) ;
local python-interpreter-pattern = "^<target-os>$(target-os):<python.interpreter>(.+)$" ;
python-interpreter = [ MATCH "$(python-interpreter-pattern)" : $(parsed-python-requirements[3]) ] ;
if ! $(python-interpreter)
{
errors.user-error
No python interpreter parsed from string: '$(parsed-python-requirements[3])'
by pattern '$(python-interpreter-pattern)'
;
}
local python-site-packages =
[ SHELL "$(python-interpreter) -c 'import site; print(site.getsitepackages()[0])'" : strip-eol ] ;
path-constant ASYNCHRONIZER_PYTHON_SITE_PACKAGES : $(python-site-packages) ;
path-constant ASYNCHRONIZER_ROOT : . ;
# Set up Boost.Build module search path
modules.poke : BOOST_BUILD_PATH : "$(ASYNCHRONIZER_ROOT)/jam" [ modules.peek : BOOST_BUILD_PATH ] ;
use-project boost : "$(BOOST_ROOT)" ;
project asynchronizer
: build-dir build
:
requirements
<include>"$(ASYNCHRONIZER_ROOT)/include"
<include>"$(BOOST_ROOT)"
;
build-project ext_src ;
alias install : install-py ext_src//install-ext ;
explicit install ;
install install-py
: asynchronizer.py
: <location>"$(ASYNCHRONIZER_PYTHON_SITE_PACKAGES)"
;
explicit install-py ;
alias install-test-async-sleep-ext : ext_src//install-test-async-sleep-ext ;
explicit install-test-async-sleep-ext ;