This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
binding.gyp
88 lines (88 loc) · 3.4 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
{
"targets": [
{
"target_name": "cws",
"sources": [
'src/Addon.h',
'src/Addon.cpp',
'src/Extensions.cpp',
'src/Group.cpp',
'src/Networking.cpp',
'src/Hub.cpp',
'src/cSNode.cpp',
'src/WebSocket.cpp',
'src/HTTPSocket.cpp',
'src/Socket.cpp'
],
'conditions': [
['OS=="linux"', {
'cflags_cc': ['-std=c++17', '-DUSE_LIBUV'],
'cflags_cc!': ['-fno-exceptions', '-std=gnu++17', '-fno-rtti'],
'cflags!': ['-fno-omit-frame-pointer'],
'ldflags!': ['-rdynamic'],
'ldflags': ['-s']
}],
['OS=="freebsd"', {
'cflags_cc': ['-std=c++17', '-DUSE_LIBUV'],
'cflags_cc!': ['-fno-exceptions', '-std=gnu++17', '-fno-rtti'],
'cflags!': ['-fno-omit-frame-pointer'],
'ldflags!': ['-rdynamic'],
'ldflags': ['-s']
}],
['OS=="mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17',
'CLANG_CXX_LIBRARY': 'libc++',
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'GCC_THREADSAFE_STATICS': 'YES',
'GCC_OPTIMIZATION_LEVEL': '3',
'GCC_ENABLE_CPP_RTTI': 'YES',
'OTHER_CFLAGS!': ['-fno-strict-aliasing'],
'OTHER_CPLUSPLUSFLAGS': ['-DUSE_LIBUV']
}
}],
['OS=="win"', {
'cflags_cc': ['/DUSE_LIBUV'],
'cflags_cc!': []
}]
]
},
{
'target_name': 'action_after_build',
'type': 'none',
'dependencies': ['cws'],
'conditions': [
['OS!="win"', {
'actions': [
{
'action_name': 'move_lib',
'inputs': [
'<@(PRODUCT_DIR)/cws.node'
],
'outputs': [
'cws'
],
'action': ['cp', '<@(PRODUCT_DIR)/cws.node', 'dist/bindings/cws_<!@(node -p process.platform)_<!@(node -p process.versions.modules).node']
}
]}
],
['OS=="win"', {
'actions': [
{
'action_name': 'move_lib',
'inputs': [
'<@(PRODUCT_DIR)/cws.node'
],
'outputs': [
'cws'
],
'action': ['copy', '<@(PRODUCT_DIR)/cws.node', 'dist/bindings/cws_<!@(node -p process.platform)_<!@(node -p process.versions.modules).node']
}
]}
]
]
}
]
}