forked from nodegit/nodegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
executable file
·62 lines (49 loc) · 1.36 KB
/
wscript
File metadata and controls
executable file
·62 lines (49 loc) · 1.36 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
61
import Options, Utils
import os, shutil, platform
from os.path import exists, abspath
from subprocess import Popen
# Ensure version is updated with each new release.
VERSION = '0.0.6'
# These constants shouldn't change, probably.
APPNAME = 'nodegit'
srcdir = '.'
blddir = 'build'
def set_options(opt):
opt.tool_options('gcc')
opt.tool_options('compiler_cxx')
def configure(conf):
import preproc
preproc.go_absolute = True
conf.check_tool('gcc')
conf.check_tool('compiler_cxx')
conf.check_tool('node_addon')
# Build libgit2, create necessary folders
os.mkdir('vendor/libgit2/build')
os.chdir('vendor/libgit2/build')
Popen('cmake -DBUILD_TESTS=OFF -DTHREADSAFE=ON .. ', shell=True).wait()
conf.env.append_value('LIBPATH_GIT2', abspath('.'))
conf.env.append_value('LIB_GIT2', 'git2')
def build(bld):
try: os.chdir('vendor/libgit2/build')
except: pass
Popen('cmake --build .', shell=True).wait()
os.chdir('../../')
main = bld.new_task_gen('cxx', 'shlib', 'node_addon')
main.target = 'nodegit'
main.source = '''
src/base.cc
src/sig.cc
src/blob.cc
src/error.cc
src/object.cc
src/reference.cc
src/repo.cc
src/commit.cc
src/oid.cc
src/revwalk.cc
src/tree.cc
src/tree_entry.cc
'''
main.includes = './vendor/libgit2/include'
main.rpath = '$ORIGIN/../../vendor/libgit2/build'
main.uselib = 'GIT2'