forked from TryGhost/node-sqlite3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinding.gyp
78 lines (78 loc) · 1.85 KB
/
binding.gyp
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
69
70
71
72
73
74
75
76
77
78
{
'includes': [ 'deps/common-sqlite.gypi' ],
'variables': {
'sqlite%':'internal',
},
'conditions': [
['OS=="win"', {
'variables': {
'copy_command%': 'copy',
'bin_name':'call'
},
},{
'variables': {
'copy_command%': 'cp',
'bin_name':'node'
},
}]
],
'targets': [
{
'target_name': 'action_before_build',
'type': 'none',
'actions': [
{
'action_name': 'unpack_sqlite_dep',
'inputs': [
'./deps/sqlite-autoconf-<@(sqlite_version).tar.gz'
],
'outputs': [
'./deps/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
],
'action': ['<@(bin_name)','./node_modules/.bin/targz','deps/sqlite-autoconf-<@(sqlite_version).tar.gz','-x','deps/']
}
]
},
{
'target_name': 'node_sqlite3',
'conditions': [
['sqlite != "internal"', {
'libraries': [
'-L<@(sqlite)/lib',
'-lsqlite3'
],
'include_dirs': [ '<@(sqlite)/include' ]
},
{
'dependencies': [
'action_before_build',
'deps/sqlite3.gyp:sqlite3'
]
}
]
],
'sources': [
'src/database.cc',
'src/node_sqlite3.cc',
'src/statement.cc'
],
},
{
'target_name': 'action_after_build',
'type': 'none',
'dependencies': [ 'node_sqlite3' ],
'actions': [
{
'action_name': 'move_node_module',
'inputs': [
'<@(PRODUCT_DIR)/node_sqlite3.node'
],
'outputs': [
'lib/node_sqlite3.node'
],
'action': ['<@(copy_command)', '<@(PRODUCT_DIR)/node_sqlite3.node', 'lib/node_sqlite3.node']
}
]
}
]
}