Skip to content

Commit b70501d

Browse files
committed
Add support for building on Android
1 parent 1161317 commit b70501d

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

binding.gyp

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"<(OZW_INC)",
114114
"<(OZW_INC)/value_classes"
115115
],
116-
"cflags": [
116+
"cflags": [
117117
"-Wno-ignored-qualifiers",
118118
"-Wno-write-strings",
119119
"-Wno-unknown-pragmas",
@@ -122,7 +122,7 @@
122122
"cflags_cc": [
123123
"-std=c++11"
124124
],
125-
"cflags_cc!": [
125+
"cflags_cc!": [
126126
"<!@(find <(OZW_INC) -name OZWException.h -exec echo -n \"-fno-exceptions\" \\;)"
127127
]
128128
}],
@@ -162,7 +162,7 @@
162162
'/usr/local/include/openzwave/',
163163
'/usr/local/include/openzwave/value_classes/'
164164
],
165-
}],
165+
}],
166166
['OS=="win"', {
167167
"variables": {
168168
"OZW_HOME": "<!(node lib/install-ozw.js --get-ozw-home)"
@@ -190,6 +190,44 @@
190190
"link_settings": {
191191
"libraries": ["dnsapi.lib", "ws2_32.lib"]
192192
}
193+
}],
194+
["OS=='android'", {
195+
"variables": {
196+
"NODE" : "<!(which node || which nodejs)",
197+
"OZW_INC" : "<!(<(NODE) -p \"require('./lib/ozwpaths.js').includedir || '/usr/*/include'\")",
198+
"OZW_LIB_PATH" : "<!(<(NODE) -p \"require('./lib/ozwpaths.js').libdir\")",
199+
"OZW_ETC" : "<!(<(NODE) -p \"require('./lib/ozwpaths.js').sysconfdir\")",
200+
"OZW_DOC" : "<!(<(NODE) -p \"require('./lib/ozwpaths.js').docdir\")"
201+
},
202+
"defines": [
203+
"OPENZWAVE_ETC=<!@(<(NODE) -p -e \"'<(OZW_ETC)'.length ? '<(OZW_ETC)' : '/usr/local/etc/openzwave'\")",
204+
"OPENZWAVE_DOC=<!@(<(NODE) -p -e \"'<(OZW_DOC)'.length ? '<(OZW_DOC)' : '/usr/local/share/doc/openzwave'\")",
205+
"OPENZWAVE_SECURITY=<!@(find <(OZW_INC) -name ZWSecurity.h | wc -l)",
206+
"OPENZWAVE_EXCEPTIONS=<!@(find <(OZW_INC) -name OZWException.h | wc -l)",
207+
"OPENZWAVE_16=<!@(find <(OZW_INC) -name ValueBitSet.h | wc -l)",
208+
"OPENZWAVE_VALUETYPE_FROM_ENUM=<!@(grep -r GetTypeNameFromEnum <(OZW_INC)/value_classes | wc -l)",
209+
"OPENZWAVE_VALUETYPE_FROM_VALUEID=<!@(grep -r GetTypeAsString <(OZW_INC)/value_classes | wc -l)"
210+
],
211+
"link_settings": {
212+
"libraries": ["-lopenzwave"]
213+
},
214+
"include_dirs": [
215+
"<!(<(NODE) -p -e \"require('path').dirname(require.resolve('nan'))\")",
216+
"<(OZW_INC)",
217+
"<(OZW_INC)/value_classes"
218+
],
219+
"cflags": [
220+
"-Wno-ignored-qualifiers",
221+
"-Wno-write-strings",
222+
"-Wno-unknown-pragmas",
223+
"<!@(find <(OZW_INC) -name OZWException.h -exec echo -n \"-fexceptions\" \\;)"
224+
],
225+
"cflags_cc": [
226+
"-std=c++11"
227+
],
228+
"cflags_cc!": [
229+
"<!@(find <(OZW_INC) -name OZWException.h -exec echo -n \"-fno-exceptions\" \\;)"
230+
]
193231
}]
194232
]
195233
}]

0 commit comments

Comments
 (0)