forked from joeferner/node-java
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbinding.gyp
118 lines (118 loc) · 3.16 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
"variables": {
"arch%": "amd64", # linux JVM architecture. See $(JAVA_HOME)/jre/lib/<@(arch)/server/
'conditions': [
['target_arch=="ia32"', {
'arch%': "i386"
}],
['OS=="win"', {
'javahome%': "<!(echo %JAVA_HOME%)"
}],
['OS=="linux" or OS=="mac"', {
'javahome%': "<!(echo $JAVA_HOME)"
}],
['OS=="mac"', {
'javaver%' : "<!(awk -F/ -v h=$JAVA_HOME 'BEGIN {n=split(h, a); print a[2]; exit}')"
}]
]
},
"targets": [
{
"target_name": "nodejavabridge_bindings",
"sources": [
"src/java.cpp",
"src/javaObject.cpp",
"src/javaScope.cpp",
"src/methodCallBaton.cpp",
"src/nodeJavaBridge.cpp",
"src/utils.cpp"
],
"include_dirs": [
"<(javahome)/include",
],
'conditions': [
['OS=="win"',
{
'actions': [
{
'action_name': 'verifyDeps',
'inputs': [
'<(javahome)/lib/jvm.lib',
'<(javahome)/include/jni.h',
'<(javahome)/include/win32/jni_md.h'
],
'outputs': ['./build/depsVerified'],
'action': ['python', 'touch.py'],
'message': 'Verify Deps'
}
],
"include_dirs": [
"<(javahome)/include/win32",
],
"libraries": [
"-l<(javahome)/lib/jvm.lib"
]
}
],
['OS=="linux"',
{
'actions': [
{
'action_name': 'verifyDeps',
'inputs': [
'<(javahome)/jre/lib/<(arch)/server/libjvm.so',
'<(javahome)/include/jni.h',
'<(javahome)/include/linux/jni_md.h'
],
'outputs': ['./build/depsVerified'],
'action': [],
'message': 'Verify Deps'
}
],
"include_dirs": [
"<(javahome)/include/linux",
],
"libraries": [
"-L<(javahome)/jre/lib/<(arch)/server/",
"-Wl,-rpath,<(javahome)/jre/lib/<(arch)/server/",
"-ljvm"
]
}
],
['OS=="mac" and javaver=="Library"',
{
"include_dirs": [
"<(javahome)/include",
"<(javahome)/include/darwin"
],
"libraries": [
"-L<(javahome)/jre/lib/server",
"-Wl,-rpath,<(javahome)/jre/lib/server",
"-ljvm"
]
}
],
['OS=="mac" and javaver=="System"',
{
"include_dirs": [
"/System/Library/Frameworks/JavaVM.framework/Headers"
],
"libraries": [
"-framework JavaVM"
]
}
],
['OS=="mac" and javaver==""',
{
"include_dirs": [
"/System/Library/Frameworks/JavaVM.framework/Headers"
],
"libraries": [
"-framework JavaVM"
]
}
]
]
}
]
}