-
Notifications
You must be signed in to change notification settings - Fork 149
/
binding.gyp
92 lines (87 loc) · 3.3 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
'targets' : [
{
'target_name' : 'odbc_bindings',
'sources' : [
'src/odbc.cpp',
'src/odbc_connection.cpp',
'src/odbc_statement.cpp',
'src/odbc_result.cpp',
],
'include_dirs': [
"<!(node -e \"require('nan')\")"
],
'conditions' : [
[ 'OS != "zos"',
{ 'defines' : [ 'UNICODE'], }
]
],
"variables": {
# Set the linker location, no extra linking needed, just link backwards one directory
"ORIGIN_LIB_PATH%": "$$ORIGIN/../../installer/clidriver/lib",
},
'conditions' : [
[ '(OS == "linux" and (target_arch =="ia32" or target_arch == "s390" or target_arch == "ppc32")) or (OS == "aix" and target_arch == "ppc")',
{ 'conditions' : [
[ 'IS_DOWNLOADED == "true" ',
{ 'ldflags' : [ "-Wl,-R,'<(ORIGIN_LIB_PATH)' " ] }
]
],
'libraries' : [ '-L$(IBM_DB_HOME)/lib -L$(IBM_DB_HOME)/lib32 ', '-ldb2' ],
'include_dirs': ['$(IBM_DB_HOME)/include'],
'cflags' : ['-g'],
}],
[ '(OS == "linux" or OS == "aix") and (target_arch =="x64" or target_arch == "s390x" or target_arch == "ppc64")',
{ 'conditions' : [
[ 'IS_DOWNLOADED == "true" ',
{ 'ldflags' : ["-Wl,-R,'<(ORIGIN_LIB_PATH)' " ], }
]
],
'libraries' : ['-L$(IBM_DB_HOME)/lib -L$(IBM_DB_HOME)/lib64 ','-ldb2' ],
'include_dirs': ['$(IBM_DB_HOME)/include'],
'cflags' : ['-g'],
}],
[ 'OS == "zos" ',
{ 'libraries' : ['dsnao64c.x'],
'include_dirs': ['build/include'],
'cflags' : ['-g']
}],
[ 'OS == "mac"',
{ 'xcode_settings': {'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' },
'libraries' : ['-L$(IBM_DB_HOME)/lib ', '-ldb2'],
'include_dirs': ['$(IBM_DB_HOME)/include'],
'cflags' : ['-g']
}],
[ 'OS=="win" and target_arch =="ia32"',
{ 'sources' : ['src/strptime.c', 'src/odbc.cpp'],
'libraries': [
'$(IBM_DB_HOME)/lib/db2app.lib'],
'include_dirs': ['$(IBM_DB_HOME)/include']
}],
[ 'OS=="win" and target_arch =="x64"',
{ 'sources' : ['src/strptime.c', 'src/odbc.cpp'],
'libraries': [
'$(IBM_DB_HOME)/lib/db2app64.lib'],
'include_dirs': ['$(IBM_DB_HOME)/include'],
}],
[ 'OS != "linux" and OS!="win" and OS!="mac" and target_arch =="ia32" ',
{ 'conditions' : [
[ 'IS_DOWNLOADED == "true" ',
{'ldflags' : ["-Wl,-R,'<(ORIGIN_LIB_PATH)' "]}]
],
'libraries' : ['-L$(IBM_DB_HOME)/lib -L$(IBM_DB_HOME)/lib32 ', '-ldb2'],
'include_dirs': ['$(IBM_DB_HOME)/include'],
'cflags' : ['-g']
}],
[ 'OS != "linux" and OS != "win" and OS != "mac" and target_arch == "x64" ',
{ 'conditions' : [
['IS_DOWNLOADED == "true" ', {'ldflags' : ["-Wl,-R,'<(ORIGIN_LIB_PATH)' "]}]
],
'libraries' : ['-L$(IBM_DB_HOME)/lib -L$(IBM_DB_HOME)/lib64 ', '-ldb2'],
'include_dirs': ['$(IBM_DB_HOME)/include'],
'cflags' : ['-g']
}]
]
}
]
}