-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwscript
46 lines (40 loc) · 1.29 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
import sys
srcdir = '.'
blddir = 'build'
VERSION = '0.0.1'
def set_options(opt):
opt.tool_options("compiler_cxx")
opt.tool_options('compiler_cc')
def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
conf.check_tool("compiler_cc")
def build(bld):
# list.c
listlib = bld.new_task_gen('cc')
listlib.source = 'src/nwm/list.c'
listlib.cflags = ['-std=c99', '-pedantic', '-Wall', '-fPIC']
# nwm.c
nwmlib = bld.new_task_gen('cc')
nwmlib.source = 'src/nwm/nwm.c'
nwmlib.cflags = ['-std=c99', '-pedantic', '-Wall', '-fPIC']
if sys.platform.startswith("darwin"):
nwmlib.linkflags=[ '-L/usr/X11/lib']
else:
nwmlib.framework=['X11','Xinerama']
nwmlib.lib=['X11', 'Xinerama']
# nwm_node.cc
if sys.platform.startswith("darwin"):
nwm = bld.new_task_gen('cxx', 'shlib', 'node_addon')
nwm.linkflags=[ '-L/usr/X11/lib']
else:
nwm = bld.new_task_gen('cxx', 'shlib', 'node_addon')
nwm.framework = ['X11', 'Xinerama']
nwm.lib=['X11', 'Xinerama']
nwm.cxxflags = ["-g", "-static", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
nwm.target = "nwm"
nwm.source = "src/nwm/nwm_node.cc"
bld.env.append_value('LINKFLAGS', [
bld.srcnode.abspath(bld.env)+'src/nwm/list_1.o',
bld.srcnode.abspath(bld.env)+'src/nwm/nwm_2.o',
])