Skip to content

Commit b609d96

Browse files
garrettsummerfi3ldqwertychouskie
authored andcommitted
Add macOS and Linux platforms
New platforms are able to link and build. Tested on macOS.
1 parent 3929fbd commit b609d96

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

binding.gyp

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'sources': [
66
'src/addon.cc',
77
'src/canWrapper.cc',
8-
],
8+
],
99
'include_dirs': [
1010
"src/",
1111
"externalCompileTimeDeps/include",
@@ -15,21 +15,46 @@
1515
"NAPI_VERSION=<(napi_build_version)"
1616
],
1717
'dependencies': ["<!(node -p \"require('node-addon-api').gyp\")"],
18-
'libraries': [
19-
# These files were placed by download-CanBridge.mjs
20-
'<(module_root_dir)/externalCompileTimeDeps/CANBridge.lib',
21-
'<(module_root_dir)/externalCompileTimeDeps/wpiHal.lib',
22-
'<(module_root_dir)/externalCompileTimeDeps/wpiutil.lib',
18+
'conditions': [
19+
['OS=="mac"', {
20+
'libraries': [
21+
# These files were placed by download-CanBridge.mjs
22+
'<(module_root_dir)/externalCompileTimeDeps/libCANBridge.a',
23+
],
24+
'copies': [{
25+
'destination': './build/Release',
26+
'files': [
27+
# These files were placed in the prebuilds folder by download-CanBridge.mjs
28+
'<(module_root_dir)/prebuilds/darwin-x64/libCANBridge.dylib',
29+
'<(module_root_dir)/prebuilds/darwin-x64/libwpiHal.dylib',
30+
'<(module_root_dir)/prebuilds/darwin-x64/libwpiutil.dylib',
31+
]
32+
}],
33+
}],
34+
['OS=="win"', {
35+
'libraries': [
36+
# These files were placed by download-CanBridge.mjs
37+
'<(module_root_dir)/externalCompileTimeDeps/CANBridge.lib',
38+
'<(module_root_dir)/externalCompileTimeDeps/wpiHal.lib',
39+
'<(module_root_dir)/externalCompileTimeDeps/wpiutil.lib',
40+
],
41+
}],
42+
['OS=="linux"', {
43+
'libraries': [
44+
# These files were placed by download-CanBridge.mjs
45+
'<(module_root_dir)/externalCompileTimeDeps/libCANBridge.a',
46+
],
47+
'copies': [{
48+
'destination': './build/Release',
49+
'files': [
50+
# These files were placed in the prebuilds folder by download-CanBridge.mjs
51+
'<(module_root_dir)/prebuilds/linux-x64/libCANBridge.so',
52+
'<(module_root_dir)/prebuilds/linux-x64/libwpiHal.so',
53+
'<(module_root_dir)/prebuilds/linux-x64/libwpiutil.so',
54+
]
55+
}],
56+
}],
2357
],
24-
'copies': [{
25-
'destination': './build/Release',
26-
'files': [
27-
# These files were placed in the prebuilds folder by download-CanBridge.mjs
28-
'<(module_root_dir)/prebuilds/win32-x64/CANBridge.dll',
29-
'<(module_root_dir)/prebuilds/win32-x64/wpiHal.dll',
30-
'<(module_root_dir)/prebuilds/win32-x64/wpiutil.dll',
31-
]
32-
}],
3358
'msvs_settings': {
3459
'VCCLCompilerTool': {
3560
'ExceptionHandling': 1,

0 commit comments

Comments
 (0)