forked from keeferrourke/rhpman-sim
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wscript
106 lines (80 loc) · 2.86 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
95
96
97
98
99
100
101
102
103
104
105
106
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# def options(opt):
# pass
# def configure(conf):
# conf.check_nonfatal(header_name='stdint.h', define_name='HAVE_STDINT_H')
def build(bld):
module = bld.create_ns3_module('rhpman', ['core', 'stats', 'aodv', 'dsdv', 'internet', 'mobility', 'energy', 'wifi'])
module.source = [
'model/rhpman.cc',
'model/dataItem.cc',
'model/storage.cc',
'model/nsutil.cc',
'model/rhpman-stats.cc',
'model/table.cc',
'model/logging.cc',
'model/dataAccess.cc',
'helper/rhpman-helper.cc',
'model/proto/messages.proto',
'helper/data-access-helper.cc'
]
module.cxxflags = ['-I./contrib/rhpman/model']
module_test = bld.create_ns3_module_test_library('rhpman')
module_test.source = [
'test/rhpman-test-suite.cc',
'test/storage-tests.cc',
'test/stats-tests.cc',
'test/dataItem-tests.cc',
'test/table-tests.cc',
'test/rhpman-tests.cc',
]
# Tests encapsulating example programs should be listed here
if (bld.env['ENABLE_EXAMPLES']):
module_test.source.extend([
# 'test/rhpman-examples-test-suite.cc',
])
headers = bld(features='ns3header')
headers.module = 'rhpman'
headers.source = [
'model/rhpman.h',
'model/storage.h',
'model/dataItem.h',
'model/rhpman-stats.h',
'model/table.h',
'model/dataAccess.h',
'helper/rhpman-helper.h',
'helper/data-access-helper.h',
]
if bld.env.ENABLE_EXAMPLES:
bld.recurse('examples')
# bld.ns3_python_bindings()
##
# This code is taken from:
# https://stackoverflow.com/questions/11274070/integrate-protocol-buffers-into-waf
###
from waflib.Task import Task
from waflib.TaskGen import extension
"""
A simple tool to integrate protocol buffers into your build system.
def configure(conf):
conf.load('compiler_cxx cxx protoc_cxx')
def build(bld):
bld.program(source = "main.cpp file1.proto proto/file2.proto",
target = "executable")
"""
class protoc(Task):
run_str = '${PROTOC} ${SRC} --cpp_out=. -I..' # set this to ../.. when running with sem and to .. when running normally
color = 'BLUE'
ext_out = ['pb.h', 'pb.cc']
@extension('.proto')
def process_protoc(self, node):
cpp_node = node.change_ext('.pb.cc')
hpp_node = node.change_ext('.pb.h')
self.create_task('protoc', node, [cpp_node, hpp_node])
self.source.append(cpp_node)
self.env.append_value('INCLUDES', ['.'] )
self.use = self.to_list(getattr(self, 'use', '')) + ['PROTOBUF']
def configure(conf):
conf.check_cfg(package="protobuf", uselib_store="PROTOBUF",
args=['protobuf >= 3.0.0' '--cflags', '--libs'])
conf.find_program('protoc', var='PROTOC')