-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtv.gyp
132 lines (132 loc) · 3.51 KB
/
tv.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
{
'variables': {
'tv_library%': 'static_library',
'warning_cflags%': [
'-Wall -Wextra',
'-Werror',
# '-Wcast-align',
# '-Wcast-qual',
# '-Wconversion',
'-Wdisabled-optimization',
'-Wfloat-equal -Wformat=2',
'-Winit-self -Winvalid-pch',
# '-Wmissing-format-attribute',
'-Wmissing-include-dirs -Wmissing-noreturn',
'-Wpacked -Wpointer-arith',
#'-Wswitch-default',
# '-Wswitch-enum',
'-Wvolatile-register-var',
'-Wwrite-strings',
# '-Wlogical-op -Woverlength-strings -Wstrict-overflow=5 -Wvla',
# '-Waggregate-return -Winline -Wpadded -Wunreachable-code -Wunsafe-loop-optimizations',
# '-Wlarger-than-XXXXXX',
'-Wno-unused-parameter',
],
'warning_cflags_c%': [
'-Wbad-function-cast',
# '-Wmissing-declarations -Wmissing-prototypes',
'-Wnested-externs',
'-Wold-style-definition',
'-Wstrict-prototypes',
'-Wno-sign-compare',
'-Wno-strict-aliasing',
],
'other_cflags%': [
'-ftrapv',
'-fstack-protector-all -Wstack-protector',
# '-fmudflapth -lmudflapth',
'-fno-strict-aliasing',
# '-Wstrict-aliasing=2',
'-fno-omit-frame-pointer',
'-std=gnu99',
'-pedantic',
],
'other_cflags_c%': [ ],
},
'target_defaults': {
'defines': [ '_GNU_SOURCE' ],
'cflags': [ '<@(warning_cflags)', '<@(other_cflags)' ],
'cflags_c': [ '<@(warning_cflags_c)', '<@(other_cflags_c)' ],
'xcode_settings': {
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
'GCC_OPTIMIZATION_LEVEL': '0',
'WARNING_CFLAGS': [ '<@(warning_cflags)', '<@(warning_cflags_c)' ],
'OTHER_CFLAGS': [ '<@(other_cflags)', '<@(other_cflags_c)' ],
},
'msbuild_settings': {
'ClCompile': {
'CompileAs': 'CompileAsCpp',
},
},
},
'targets': [
{
'target_name': 'libtv',
'type': '<(tv_library)',
'include_dirs': [
'deps/http-parser',
'deps/libuv/include',
'include',
],
'direct_dependent_settings': {
'include_dirs': [
'include',
'deps/http-parser',
],
},
'sources': [
'deps/http-parser/http_parser.c',
'src/md5.h',
'src/md5.c',
'src/buffer.c',
'src/handle.c',
'src/internal.h',
'src/loop.c',
'src/pipe.c',
'src/queue.h',
'src/stream.c',
'src/tcp.c',
'src/timer.c',
'src/ws.c',
'src/ws_frame.c',
'src/ws_handshake.c',
],
'conditions': [
['with_ssl != "false"', {
'defines': [
'WITH_SSL',
],
'sources': [
'src/ssl.c',
'src/wss.c',
],
}, {
'sources': [
'src/sha1.h',
'src/sha1.c',
]
}],
['OS == "win"', {
'defines': [
# https://msdn.microsoft.com/en-US/library/windows/desktop/aa383745(v=vs.85).aspx
'_WIN32_WINNT=0x0600', # supports after Windows Vista
],
}, { # Not Windows i.e. POSIX
'conditions': [
['_type == "shared_library" and OS != "mac"', {
# This will cause gyp to set soname
'product_extension': 'so.1',
}],
],
}],
['_type == "shared_library"', {
'defines': [
'BUILDING_TV_SHARED=1',
'BUILDING_WS_SHARED=1',
'USING_UV_SHARED=1',
]
}],
]
},
],
}