forked from kkaefer/DEPRECATED-node-zlib
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwscript
More file actions
32 lines (27 loc) · 854 Bytes
/
Copy pathwscript
File metadata and controls
32 lines (27 loc) · 854 Bytes
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
import Options
from os.path import exists
from shutil import copy2 as copy
TARGET = 'zlib_bindings'
TARGET_FILE = '%s.node' % TARGET
built = 'build/default/%s' % TARGET_FILE
dest = 'lib/%s' % TARGET_FILE
def set_options(opt):
opt.tool_options("compiler_cxx")
def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
if not conf.check(lib="z", libpath=['/usr/local/lib'], uselib_store="ZLIB"):
conf.fatal('Missing zlib');
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
obj.target = TARGET
obj.source = "src/node-zlib.cc"
obj.uselib = "ZLIB"
def shutdown():
if Options.commands['clean']:
if exists(TARGET_FILE):
unlink(TARGET_FILE)
else:
if exists(built):
copy(built, dest)