-
Notifications
You must be signed in to change notification settings - Fork 0
/
wscript
60 lines (51 loc) · 2.1 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
import os
import sys
from waflib import Options, Tools
def options(ctx):
ctx.load('compiler_cxx waf_unit_test')
ctx.add_option('--perf', action='store_true', help='Run all performance tests.')
ctx.add_option('--perf-printf', action='store_true', help='Run printf performance test.')
ctx.add_option('--perf-logger', action='store_true', help='Run logger performance test.')
def configure(ctx):
ctx.load('compiler_cxx waf_unit_test')
def build(ctx):
ctx(features = 'cxx',
target = 'uclog_dbg',
includes = 'include',
export_includes = 'include',
source = ctx.path.ant_glob('src/*.cpp'),
cxxflags = '-g -Wall')
ctx(features = 'cxx cxxprogram test',
target = 'test_uclog',
source = ctx.path.ant_glob('test/*.cpp'),
cxxflags = '-g -Wall -std=c++11',
lib = 'gtest pthread',
use = 'uclog_dbg')
ctx(features = 'cxx',
target = 'uclog',
includes = 'include',
export_includes = 'include',
source = ctx.path.ant_glob('src/*.cpp'),
cxxflags = '-g -Wall -DNDEBUG -O3')
ctx(features = 'cxx cxxprogram',
target = 'perf_printf',
source = ctx.path.ant_glob('test/perf/perf_printf.cpp'),
cxxflags = '-g -Wall -DNDEBUG -O3 -std=c++11',
lib = 'benchmark pthread',
use = 'uclog')
ctx(features = 'cxx cxxprogram',
target = 'perf_logger',
source = ctx.path.ant_glob('test/perf/perf_logger.cpp'),
cxxflags = '-g -Wall -DNDEBUG -O3 -std=c++11',
lib = 'benchmark pthread',
use = 'uclog')
ctx.add_post_fun(Tools.waf_unit_test.summary)
ctx.add_post_fun(Tools.waf_unit_test.set_exit_code)
if getattr(Options.options, 'perf_printf') or getattr(Options.options, 'perf'):
ctx(rule = lambda task: os.system(task.inputs[0].abspath()),
source = 'perf_printf',
always = True)
if getattr(Options.options, 'perf_logger') or getattr(Options.options, 'perf'):
ctx(rule = lambda task: os.system(task.inputs[0].abspath()),
source = 'perf_logger',
always = True)