-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbinding.gyp
111 lines (111 loc) · 3.22 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
{
'targets': [{
'target_name': 'apm_bindings',
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'include_dirs': [
'<!@(node --no-warnings -p "require(\'node-addon-api\').include")',
],
'defines': [
'NAPI_VERSION=<(napi_build_version)'
],
# preprocessor only (in bindings.o for some reason)
#'cflags': ['-E'],
# suppress warnings
#'cflags': ['-w'],
'sources': [
'src/bindings.cc',
'src/sanitizer.cc',
'src/notifier.cc',
'src/settings.cc',
'src/config.cc',
'src/event.cc',
'src/event/event-to-string.cc',
'src/event/event-send.cc',
'src/reporter.cc',
],
'conditions': [
['OS in "linux"', {
# includes reference oboe/oboe.h, so
'include_dirs': [
'<!@(node --no-warnings -p "require(\'node-addon-api\').include")',
'<(module_root_dir)/',
'<(module_root_dir)/src',
],
'libraries': [
'-loboe',
'-L<(module_root_dir)/oboe/',
'-Wl,-rpath-link,<(module_root_dir)/oboe/',
'-Wl,-rpath,\$$ORIGIN/../../oboe/'
],
}]
]
}, {
'target_name': 'ao_metrics',
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
},
'include_dirs': [
'<!@(node --no-warnings -p "require(\'nan\')")',
],
'defines': [
'NAPI_VERSION=<(napi_build_version)'
],
# preprocessor only (in bindings.o for some reason)
#'cflags': ['-E'],
# suppress warnings
#'cflags': ['-w'],
'sources': [
'src/metrics/metrics.cc',
'src/metrics/gc.cc',
'src/metrics/eventloop.cc',
'src/metrics/process.cc'
],
'conditions': [
['OS in "linux"', {
# includes reference oboe/oboe.h, so
'include_dirs': [
'<!@(node --no-warnings -p "require(\'nan\')")',
'<(module_root_dir)/',
'<(module_root_dir)/metrics'
],
'libraries': [
'-loboe',
'-L<(module_root_dir)/oboe/',
'-Wl,-rpath-link,<(module_root_dir)/oboe/',
'-Wl,-rpath,\$$ORIGIN/../../oboe/'
],
}]
]
}, {
"target_name": "action_after_build",
"type": "none",
"dependencies": ["<(module_name)"],
"copies": [
{
"files": [
# explicitly copy targets
"<(PRODUCT_DIR)/apm_bindings.node",
"<(PRODUCT_DIR)/ao_metrics.node",
# this will be linked to the correct version of liboboe by setup-liboboe.js
#"<(module_root_dir)/oboe/liboboe-1.0.so.0",
#"<!(readlink -f <(module_root_dir)/oboe/liboboe-1.0.so.0)"
],
"destination": "<(module_path)/"
}
]
}]
}