forked from Fastcode/nbsdecoder.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinding.gyp
109 lines (109 loc) · 4.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
{
"targets": [
{
"target_name": "nbsdecoder",
"sources": [
"src/binding.cpp",
"src/Decoder.cpp",
"src/Encoder.cpp",
"src/Hash.cpp",
"src/Packet.cpp",
"src/Timestamp.cpp",
"src/third-party/xxhash/xxhash.c",
],
"cflags": [],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")",
],
"defines": [
# Restrict NAPI to v6 (to support Node v10)
# Changing this should have a corresponding change to "engines" in package.json
# See https://nodejs.org/api/n-api.html#node-api-version-matrix for which
# versions of NAPI support which versions of Node
"NAPI_VERSION=6"
],
"msvs_settings": {"VCCLCompilerTool": {"ExceptionHandling": 1}},
"conditions": [
[
'OS=="linux"',
{
"ccflags": [
"-std=c++14",
"-fPIC",
"-fext-numeric-literals",
"-fexceptions",
],
"ccflags!": ["-fno-exceptions"],
"cflags_cc": ["-std=c++14", "-fext-numeric-literals"],
"cflags_cc!": ["-fno-exceptions", "-fno-rtti"],
},
],
[
'OS=="mac"',
{
"ccflags": [
"-std=c++14",
"-fPIC",
"-fext-numeric-literals",
"-fexceptions",
],
"ccflags!": ["-fno-exceptions"],
"cflags_cc": ["-std=c++14", "-fext-numeric-literals"],
"cflags_cc!": ["-fno-exceptions", "-fno-rtti"],
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET": "10.9",
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"GCC_ENABLE_CPP_RTTI": "YES",
"OTHER_CPLUSPLUSFLAGS": ["-std=c++14", "-stdlib=libc++"],
"OTHER_LDFLAGS": ["-stdlib=libc++"],
},
},
],
[
'OS=="win"',
{
"dependencies": ["zlib"],
"include_dirs": [
"src/third-party/zlib",
],
"defines": ["_HAS_EXCEPTIONS=1", "NOMINMAX=1"],
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": ["-std:c++14"],
},
},
},
],
],
},
],
"conditions": [
['OS == "win"', {
"targets": [
# Compile zlib for linking on Windows only
{
"target_name": "zlib",
"type": "static_library",
"dependencies": [],
"sources": [
"src/third-party/zlib/adler32.c",
"src/third-party/zlib/compress.c",
"src/third-party/zlib/crc32.c",
"src/third-party/zlib/deflate.c",
"src/third-party/zlib/gzclose.c",
"src/third-party/zlib/gzlib.c",
"src/third-party/zlib/gzread.c",
"src/third-party/zlib/gzwrite.c",
"src/third-party/zlib/infback.c",
"src/third-party/zlib/inffast.c",
"src/third-party/zlib/inflate.c",
"src/third-party/zlib/inftrees.c",
"src/third-party/zlib/trees.c",
"src/third-party/zlib/uncompr.c",
"src/third-party/zlib/zutil.c",
],
},
],
}],
],
}