-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwscript
87 lines (70 loc) · 3.18 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
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
VERSION = 0.1
from waflib import Utils
import os
def options(opt):
opt.load(['compiler_cxx', 'cxx', 'gnu_dirs'])
opt.load(['default-compiler-flags', 'sanitizers', 'boost', 'protoc'], tooldir=['.waf-tools'])
opt.add_option('--with-tests', action='store_true', default=False,
dest='with_tests', help='''Build unit tests''')
def configure(conf):
conf.load(['compiler_cxx', 'cxx', 'gnu_dirs', 'default-compiler-flags', 'sanitizers', 'boost', 'protoc'])
if 'PKG_CONFIG_PATH' not in os.environ:
os.environ['PKG_CONFIG_PATH'] = Utils.subst_vars('${LIBDIR}/pkgconfig', conf.env)
conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
uselib_store='NDN_CXX', mandatory=True)
boost_libs = 'system log unit_test_framework'
conf.check_boost(lib=boost_libs)
def build(bld):
bld.env['VERSION'] = VERSION
bld.stlib(target = 'vsync',
name = 'vsync',
source = bld.path.ant_glob(['lib/*.cpp', 'lib/*.proto']),
use = 'NDN_CXX BOOST',
includes = 'lib',
export_includes = 'lib',
cxxflags = '-DBOOST_LOG_DYN_LINK')
bld.install_files('${PREFIX}/include/VectorSync',
bld.path.ant_glob(['lib/*.hpp']) + bld.path.ant_glob(['build/lib/*.pb.h']))
bld.install_files('${PREFIX}/lib', 'build/libvsync.a')
bld.program(target = 'vsync-test',
name = 'vsync-test',
source = bld.path.ant_glob(['tests/*.cpp']),
includes = 'tests',
install_path = None,
use = 'NDN_CXX BOOST vsync',
cxxflags = '-DBOOST_TEST_DYN_LINK')
bld.program(target = 'simple',
name = 'simple',
source = 'examples/simple.cpp',
includes = 'examples',
install_path = None,
use = 'NDN_CXX BOOST vsync',
cxxflags = '-DBOOST_LOG_DYN_LINK')
bld.program(target = 'simple-fifo',
name = 'simple-fifo',
source = 'examples/simple-fifo.cpp',
includes = 'examples',
install_path = None,
use = 'NDN_CXX BOOST vsync',
cxxflags = '-DBOOST_LOG_DYN_LINK')
bld.program(target = 'simple-causal',
name = 'simple-causal',
source = 'examples/simple-causal.cpp',
includes = 'examples',
install_path = None,
use = 'NDN_CXX BOOST vsync',
cxxflags = '-DBOOST_LOG_DYN_LINK')
bld.program(target = 'simple-total',
name = 'simple-total',
source = 'examples/simple-total.cpp',
includes = 'examples',
install_path = None,
use = 'NDN_CXX BOOST vsync',
cxxflags = '-DBOOST_LOG_DYN_LINK')
# bld.program(target = 'kv-store',
# name = 'kv-store',
# source = 'examples/kv-store.cpp',
# includes = 'examples',
# install_path = None,
# use = 'NDN_CXX BOOST vsync')