forked from DataDog/pprof-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
136 lines (136 loc) · 3.41 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
"variables": {
"asan%": 0,
"lsan%": 0,
"ubsan%": 0,
},
"conditions": [
["OS == 'mac'", {
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET": "10.10",
'CLANG_CXX_LIBRARY': 'libc++',
"OTHER_CFLAGS": [
"-std=c++14",
"-stdlib=libc++",
"-Wall",
"-Werror",
"-Wno-deprecated-declarations",
]
},
}],
["OS == 'linux'", {
"link_settings": {
"libraries": ["-lrt"]
},
"cflags": [
"-std=c++14",
"-Wall",
"-Werror"
],
"cflags_cc": [
"-Wno-cast-function-type",
# TODO: Remove when nan is updated to support v18 properly
"-Wno-deprecated-declarations",
]
}],
["OS == 'win'", {
"cflags": [
"/WX"
]
}],
# No macOS support for -fsanitize=leak
["lsan == 'true' and OS != 'mac'", {
"cflags+": ["-fsanitize=leak"],
"ldflags": ["-fsanitize=leak"],
}],
["asan == 'true' and OS != 'mac'", {
"cflags+": [
"-fno-omit-frame-pointer",
"-fsanitize=address",
"-fsanitize-address-use-after-scope",
],
"cflags!": [ "-fomit-frame-pointer" ],
"ldflags": [ "-fsanitize=address" ],
}],
["asan == 'true' and OS == 'mac'", {
"xcode_settings+": {
"OTHER_CFLAGS+": [
"-fno-omit-frame-pointer",
"-gline-tables-only",
"-fsanitize=address",
],
"OTHER_CFLAGS!": [
"-fomit-frame-pointer",
],
"OTHER_LDFLAGS": [
"-fsanitize=address",
],
},
}],
# UBSAN
["ubsan == 'true' and OS != 'mac'", {
"cflags+": [
"-fsanitize=undefined,alignment,bounds",
"-fno-sanitize-recover",
],
"ldflags": [
"-fsanitize=undefined,alignment,bounds"
],
}],
["ubsan == 'true' and OS == 'mac'", {
"xcode_settings+": {
"OTHER_CFLAGS+": [
"-fsanitize=undefined,alignment,bounds",
"-fno-sanitize-recover",
],
"OTHER_LDFLAGS": [
"-fsanitize=undefined,alignment,bounds"
],
},
}],
],
"targets": [
{
"target_name": "dd_pprof",
"sources": [
"bindings/profilers/cpu.cc",
"bindings/profilers/heap.cc",
"bindings/profilers/wall.cc",
"bindings/code-event-record.cc",
"bindings/code-map.cc",
"bindings/cpu-time.cc",
"bindings/location.cc",
"bindings/per-isolate-data.cc",
"bindings/sample.cc",
"bindings/binding.cc",
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
],
},
{
"target_name": "test_dd_pprof",
"sources": [
"bindings/profilers/cpu.cc",
"bindings/profilers/heap.cc",
"bindings/profilers/wall.cc",
"bindings/code-event-record.cc",
"bindings/code-map.cc",
"bindings/cpu-time.cc",
"bindings/location.cc",
"bindings/per-isolate-data.cc",
"bindings/sample.cc",
"bindings/test/binding.cc",
"bindings/test/profilers/cpu.test.cc",
"bindings/test/code-event-record.test.cc",
"bindings/test/code-map.test.cc",
"bindings/test/cpu-time.test.cc",
"bindings/test/location.test.cc",
"bindings/test/sample.test.cc",
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
],
},
]
}