-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
85 lines (63 loc) · 2.2 KB
/
Copy pathwscript
File metadata and controls
85 lines (63 loc) · 2.2 KB
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
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import sys
import os
from waflib import Logs, Utils, Context
top = "."
out = "build"
def recurseCtx(ctx):
ctx.recurse("shared")
ctx.recurse("node")
# ctx.recurse("manager")
# ctx.recurse("thermometer")
# ctx.recurse("consumer")
# ctx.recurse("producer")
def test(ctx):
modules = [
"node",
"manager",
]
base = ctx.path.abspath()
ctx.exec_command("rm {base}/manager-db".format(**locals()))
for m in modules:
print("- " * 4 + "Test: " + m + " -" * 4)
ctx.exec_command("{base}/build/{m}/unit_tests".format(**locals()))
print("")
print("")
def build(bld):
recurseCtx(bld)
def options(opt):
opt.load(['compiler_cxx', 'gnu_dirs'])
opt.load(['boost',
'default-compiler-flags',
'compiler-features',
'dependency-checker'],
tooldir=['.waf-tools'])
opt.add_option('--with-tests',
action='store_true',
default=False,
dest='with_tests',
help='''Build unit tests''')
def configure(conf):
print('→ configuring the project in ' + conf.path.abspath())
conf.load(['compiler_cxx', 'gnu_dirs',
'default-compiler-flags',
'compiler-features',
'dependency-checker'])
conf.env.DEFINES = ["ELPP_FEATURE_CRASH_LOG"]
conf.env.DEFINES = ["CATCH_CONFIG_FAST_COMPILE"]
if sys.platform != 'win32':
conf.env.LIB = ["boost_system", "ndn-cxx"]
conf.env.LIBPATH = ["/usr/local/lib"]
conf.env.INCLUDES = ["/usr/local/include"]
else :
raise ctx.fatal("windows not supported")
conf.check_cfg(package='libndn-cxx',
args=['--cflags', '--libs'],
uselib_store='NDN_CXX', mandatory=True)
boost_libs = 'system filesystem date_time iostreams \
regex chrono program_options thread log log_setup'
conf.check_boost(lib=boost_libs, mandatory=True, mt=True)
if conf.options.with_tests:
conf.env['WITH_TESTS'] = 1
conf.define('WITH_TESTS', 1)
recurseCtx(conf)