-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwscript
94 lines (82 loc) · 3.23 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import os
def options(opt):
opt.load('compiler_cxx gnu_dirs boost waf_unit_test')
def configure(conf):
conf.load('compiler_cxx gnu_dirs boost waf_unit_test')
conf.check_boost(lib='system thread')
def build(bld):
default_flags=['-Wall', '-Wextra', '-Ofast']
# default_flags=['-Wall', '-Wextra', '-g']
use_packages=['BOOST']
includes=['json5_parser']
sources=['json5_parser/json5_parser_reader.cpp',
'json5_parser/json5_parser_writer.cpp',
'json5_parser/json5_parser_value.cpp']
bld.shlib(source=sources,
target='json5_parser',
name='libjson5_parser_sh',
includes=includes,
cxxflags=default_flags,
install_path=bld.env.LIBDIR,
use=use_packages,
vnum='1.0.0'
)
bld.stlib(source=sources,
target='json5_parser',
name='libjson5_parser_st',
includes=includes,
cxxflags=default_flags,
install_path=bld.env.LIBDIR,
use=use_packages
)
# Demo programs
bld.program(features='test',
source=['json_demo/json_demo.cpp'],
target='json5_demo',
includes=includes,
cxxflags=default_flags,
rpath=[bld.env.LIBDIR],
use=use_packages + ['libjson5_parser_st'],
install_path=None
)
bld.program(features='test',
source=['json_map_demo/json_map_demo.cpp'],
target='json5_map_demo',
includes=includes,
cxxflags=default_flags,
rpath=[bld.env.LIBDIR],
use=use_packages + ['libjson5_parser_st'],
install_path=None
)
bld.program(features='test',
source=['json_headers_only_demo/json_headers_only_demo.cpp'],
target='json5_headers_only_demo',
includes=includes,
cxxflags=default_flags,
rpath=[bld.env.LIBDIR],
use=use_packages + ['libjson5_parser_st'],
install_path=None
)
bld.program(features='test',
source=['json_test/json5_parser_reader_test.cpp',
'json_test/json5_parser_stream_reader_test.cpp',
'json_test/json5_parser_utils_test.cpp',
'json_test/json5_parser_value_test.cpp',
'json_test/json5_parser_writer_test.cpp',
'json_test/json_test.cpp',
'json_test/utils_test.cpp'
],
target='json5_test',
includes=includes,
cxxflags=default_flags,
rpath=[bld.env.LIBDIR],
use=use_packages + ['libjson5_parser_st'],
install_path=None
)
# install headers
bld.install_files(bld.env.INCLUDEDIR,
bld.path.ant_glob('json5_parser/*.h'),
cwd=bld.path.find_dir('json5_parser'),
relative_trick=True)
from waflib.Tools import waf_unit_test
bld.add_post_fun(waf_unit_test.summary)