Skip to content

Commit 9820b26

Browse files
authored
Merge pull request #366 from zzattack/master
Add support for building on FreeBSD
2 parents 460f0a8 + b269b6b commit 9820b26

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

binding.gyp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,43 @@
126126
"<!@(find <(OZW_INC) -name OZWException.h -exec echo -n \"-fno-exceptions\" \\;)"
127127
]
128128
}],
129+
['OS=="freebsd"', {
130+
"variables": {
131+
"OZW_INC" : "<!(pkg-config --cflags-only-I libopenzwave | sed s/-I//g)",
132+
"OZW_LIB_PATH" : "<!(pkg-config --variable=libdir libopenzwave)",
133+
"OZW_GITVERSION" : "<!(pkg-config --variable=gitversion libopenzwave)",
134+
"OZW_ETC" : "<!(pkg-config --variable=sysconfdir libopenzwave)",
135+
"OZW_DOC" : "<!(pkg-config --variable=docdir libopenzwave)"
136+
},
137+
"defines": [
138+
"OPENZWAVE_ETC=<(OZW_ETC)/config",
139+
"OPENZWAVE_DOC=<!@(node -p -e \"'<(OZW_DOC)'.length ? '<(OZW_DOC)' : '/usr/local/share/doc/openzwave'\")",
140+
"OPENZWAVE_SECURITY=<!@(find <(OZW_INC) -name ZWSecurity.h | wc -l)",
141+
"OPENZWAVE_EXCEPTIONS=<!@(find <(OZW_INC) -name OZWException.h | wc -l)",
142+
"OPENZWAVE_16=<!@(find <(OZW_INC) -name ValueBitSet.h | wc -l)",
143+
"OPENZWAVE_VALUETYPE_FROM_ENUM=<!@(grep -r GetTypeNameFromEnum <(OZW_INC)/value_classes | wc -l)",
144+
"OPENZWAVE_VALUETYPE_FROM_VALUEID=<!@(grep -r GetTypeAsString <(OZW_INC)/value_classes | wc -l)"
145+
],
146+
"cflags": [
147+
"-Wno-ignored-qualifiers",
148+
"-Wno-write-strings",
149+
"-Wno-unknown-pragmas",
150+
"<!@(find <(OZW_INC) -name OZWException.h -exec echo -n \"-fexceptions\" \\;)"
151+
],
152+
"cflags_cc!": [
153+
"<!@(find <(OZW_INC) -name OZWException.h -exec echo -n \"-fno-exceptions\" \\;)"
154+
],
155+
"link_settings": {
156+
"libraries": [
157+
"-L/usr/local/lib/", "-lopenzwave"
158+
]
159+
},
160+
"include_dirs": [
161+
"<!(node -p -e \"require('path').dirname(require.resolve('nan'))\")",
162+
'/usr/local/include/openzwave/',
163+
'/usr/local/include/openzwave/value_classes/'
164+
],
165+
}],
129166
['OS=="win"', {
130167
"variables": {
131168
"OZW_HOME": "<!(node lib/install-ozw.js --get-ozw-home)"

src/openzwave.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "Options.h"
3535
#include "Value.h"
3636

37-
#if defined(_WIN32) || defined( __APPLE__)
37+
#if defined(_WIN32) || defined( __APPLE__) || __cplusplus >= 201103L
3838
#include <unordered_map>
3939
typedef ::std::unordered_map < ::std::string, OpenZWave::Driver::ControllerCommand > CommandMap;
4040
#else

0 commit comments

Comments
 (0)