-
Notifications
You must be signed in to change notification settings - Fork 25
/
wscript
68 lines (56 loc) · 1.78 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
import sys
import Options
import os
# nice, but requires python 2.6 ...
#import json
#package = json.load(open('package.json'))
#APPNAME = 'node_' + package['name'] # used by 'node-waf dist'
#VERSION = package['version'] # dito
APPNAME = 'node_dbus'
VERSION = '0.0.1'
def set_options(opt):
opt.tool_options('compiler_cxx')
opt.tool_options('compiler_cc')
opt.tool_options('node_addon')
def configure(conf):
conf.check_tool('compiler_cxx')
conf.check_tool('compiler_cc')
conf.check_tool('node_addon')
conf.check_cfg(
package='dbus-1'
, args='--cflags --libs'
, uselib_store='DBUS'
)
conf.check_cc(lib='expat', uselib_store='EXPAT', mandatory=True)
conf.check_cc(header_name='expat.h', mandatory=True)
conf.write_config_header('node_dbus_config.h');
def post_build(ctx):
#print("=== post")
if not os.path.exists('lib/binding.node'):
os.symlink( '../build/default/binding.node', 'lib/binding.node')
if not os.path.exists('lib/tests.node'):
os.symlink( '../build/default/tests.node', 'lib/tests.node')
def build(bld):
bld.add_post_fun(post_build)
addon = bld.new_task_gen('cxx', 'shlib', 'node_addon')
addon.target = 'binding'
addon.uselib = ['DBUS', 'EXPAT']
addon.cxxflags = ['-Wall']
addon.include = '.'
addon.source = [
'src/binding.cpp'
, 'src/node_dbus_connection.cpp'
, 'src/node_dbus_utils.cpp'
, 'src/node_dbus_watch.cpp'
, 'src/node_dbus_timeout.cpp'
, 'src/node_dbus_message.cpp'
, 'src/node_dbus_message_iter.cpp'
, 'src/node_dbus_pending_call.cpp'
, 'src/node_dbus_introspection.cpp'
, 'src/node_dbus_server.cpp'
]
tests = bld.new_task_gen('cxx', 'shlib', 'node_addon')
tests.target = 'tests'
tests.uselib = 'DBUS'
tests.source = 'src/tests.cpp'
# vim: set filetype=python :