forked from boostorg/release-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci_boost_build.py
55 lines (36 loc) · 1.29 KB
/
ci_boost_build.py
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
#!/usr/bin/env python
# Copyright Rene Rivera 2016
# Copyright Peter Dimov 2017
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import sys
import os.path
from ci_boost_common import main, utils, script_common
class script(script_common):
def __init__(self, ci_klass, **kargs):
script_common.__init__(self, ci_klass, **kargs)
def init(self, opt, kargs):
kargs = super(script,self).init(opt,kargs)
opt.add_option( '--toolset' )
self.toolset = os.getenv( 'TOOLSET', None )
opt.add_option( '--cxxstd' )
self.cxxstd = os.getenv( 'CXXSTD', None )
return kargs
def command_build(self):
super(script,self).command_build()
# Build b2
os.chdir(self.root_dir)
if sys.platform == "win32":
utils.check_call('cmd.exe', '/C', os.path.join(self.root_dir, "bootstrap.bat"))
else:
utils.check_call("./bootstrap.sh")
# Build Boost
cmd = [ './b2', '-j%s' % (self.jobs) ]
if self.toolset:
cmd.append( 'toolset=' + self.toolset )
if self.cxxstd:
cmd.append( 'cxxstd=' + self.cxxstd )
utils.check_call( *cmd )
main(script)