-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwscript
executable file
·63 lines (52 loc) · 1.71 KB
/
wscript
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
top = '.'
out = 'build'
from glob import glob
import os
def options(opt):
opt.load('compiler_cxx waf_unit_test')
opt.add_option("--docs",
action="store_true",
default=False,
help="Building documentation"
)
def configure(cfg):
cfg.find_program("sphinx-build", var="SPHINXBUILD")
cfg.load('compiler_cxx waf_unit_test')
def unittest(bld):
bld.objects(source='unittest/gtest/gtest-all.cc',
includes='unittest', target='gtest')
bld.objects(source='unittest/gtest/gtest_main.cc',
includes='unittest', target='gtest_main')
for i in glob('unittest/*.cpp'):
bld.program(
features='test',
source=i,
target=i + ".unittest",
cxxflags=['-Wall', '-Werror', '-std=c++1y', '-g'],
use=['gtest', 'gtest_main']
)
from waflib.Tools import waf_unit_test
bld.add_post_fun(waf_unit_test.summary)
def build_doc(bld):
path = {
'doctrees': os.path.join(out, 'doctrees'),
'html': os.path.join(out, 'docs', 'html')
}
cmdRemoveDoctrees = "rm -rf {0}".format(path['doctrees'])
cmdSphinxBuild = (
"${{SPHINXBUILD}} -b html -d {doctrees} docs {html}".format(
**path))
bld(
rule=cmdRemoveDoctrees + " && " + cmdSphinxBuild,
cwd=bld.path.abspath(),
source=bld.path.ant_glob('docs/*.py') +
bld.path.ant_glob('docs/*.rst') +
bld.path.ant_glob('docs/**/*.rst'),
target=bld.path.find_or_declare('docs/html/index.html'),
name='html',
)
def build(bld):
if bld.options.docs:
build_doc(bld)
bld.add_group()
unittest(bld)