forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
115 lines (115 loc) · 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
'variables': {
'configuration%': '${BUILDTYPE}',
'build_arch': '<!(node -p "process.arch")',
'variables': {
'vs_configuration%': "Debug",
},
'win_realsense_dir': '<(module_root_dir)/../../build/<(vs_configuration)',
},
"targets": [
{
"target_name": "node_librealsense",
"variables": {
},
"sources": [
"./src/addon.cpp",
],
"include_dirs": [
"../../include",
"<!(node -e \"require('nan')\")",
],
"cflags!": [
"-fno-exceptions"
],
"cflags": [
"-Wno-deprecated-declarations",
"-Wno-switch",
"-std=c++11",
"-fstack-protector-strong",
"-fPIE -fPIC",
"-O2 -D_FORTIFY_SOURCE=2",
"-Wformat -Wformat-security"
],
"cflags_cc!": [
"-fno-exceptions"
],
"cflags_cc": [
"-Wno-switch",
"-Wno-deprecated-declarations"
],
"conditions": [
[
"OS==\"win\"",
{
'msvs_settings': {
'VCCLCompilerTool': {
'WarnAsError': 'false',
'DisableSpecificWarnings': ['4996', '4244'],
'SuppressStartupBanner': 'true',
}
},
"libraries": [
"<(win_realsense_dir)/realsense2.lib",
],
}
],
['OS=="mac"',
{
"libraries": [
'<(module_root_dir)/../../build/<(configuration)/librealsense2.dylib',
# Write the below RPATH into the generated addon
'-Wl,-rpath,@loader_path/../../../../build/<(configuration)',
],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOS_DEPLOYMENT_TARGET': '10.12',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14'
}
}
],
['OS=="linux"',
{
"libraries": [
"-lrealsense2"
],
'ldflags': [
# rpath for build from source
'-Wl,-rpath,\$$ORIGIN/../../../../build',
'-L<(module_root_dir)/../../build',
# rpatch for build debian package
'-Wl,-rpath,\$$ORIGIN/../../../../obj-x86_64-linux-gnu',
'-L<(module_root_dir)/../../obj-x86_64-linux-gnu'
],
"cflags+": [
"-std=c++11"
],
"cflags_c+": [
"-std=c++14"
],
"cflags_cc+": [
"-std=c++14"
]
}
]
]
},
{
"target_name": "copy_dll",
"type":"none",
"dependencies" : [ "node_librealsense" ],
"conditions": [
['OS=="win"', {
"copies":
[
{
'destination': '<(module_root_dir)/build/Release',
'files': ['<(win_realsense_dir)/realsense2.dll']
}
]
}]
]
}
]
}