- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwscript
More file actions
Latest commit
60 lines (47 loc) · 1.81 KB
/
Copy pathwscript
File metadata and controls
60 lines (47 loc) · 1.81 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
importOptions, glob
fromos.pathimportjoin, dirname, abspath, exists
fromshutilimportcopy, rmtree
fromosimportunlink
importsys, os
srcdir="."
blddir="build"
VERSION="0.0.1"
defset_options(opt):
opt.tool_options("compiler_cxx")
opt.tool_options("compiler_cc")
defconfigure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("compiler_cc")
conf.check_tool("node_addon")
conf.check_cfg(package='gl', mandatory=1, args='--cflags --libs')
conf.check_cfg(package='glu', mandatory=1, args='--cflags --libs')
conf.check_cfg(package='xrandr', mandatory=1, args='--cflags --libs')
conf.env.append_value("LIBPATH_GLFW", abspath("./build/default/lib/"))
conf.env.append_value("STATICLIB_GLFW",["glfw"])
conf.env.append_value("CPPPATH_GLFW", abspath("./build/default/include/"))
# TODO: add support for more platforms..
buildpath=abspath("build/default")
cmd="cd \"deps/glfw\" && CFLAGS=-fPIC PREFIX=%s make x11-dist-install"
ifos.system(cmd% (buildpath)) !=0:
conf.fatal("Building glfw failed.")
defclean(ctx):
ifexists("lib/node-ogl.node"): unlink("lib/node-ogl.node")
ifexists("build"): rmtree("build")
# TODO: add support for more platforms..
buildpath=abspath("build/default")
cmd="cd \"deps/glfw\" && PREFIX=%s make x11-dist-clean"
ifos.system(cmd% (buildpath)) !=0:
conf.fatal("Building glfw failed.")
defbuild(bld):
# build node-avro
node_ogl=bld.new_task_gen("cxx", "shlib", "node_addon")
node_ogl.source=bld.glob("src/*.cc")
node_ogl.name="node-ogl"
node_ogl.target="node-ogl"
node_ogl.uselib= ["GL", "GLU", "GLFW", "XRANDR"]
bld.add_post_fun(copynode)
defcopynode(ctx):
ifexists('build/default/node-ogl.node'):
copy('build/default/node-ogl.node','lib/node-ogl.node')
deftest(tst):
os.system("node test/sanity.js")