-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.gyp
156 lines (154 loc) · 4.04 KB
/
server.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
'targets': [
{
'target_name': 'server',
'type': 'executable',
'sources': [
'src/pal.h',
'src/server.c',
'src/server.h',
'<(INTERMEDIATE_DIR)/packaged-html-files.c',
],
'dependencies': [
'mongoose',
],
'actions': [
{
'action_name': 'package html files',
'inputs': [
'files-to-c-arrays.py',
'html/index.html',
'html/keep-server-alive.js',
],
'outputs': [
'<(INTERMEDIATE_DIR)/packaged-html-files.c',
],
'action': ['python', 'files-to-c-arrays.py', '<@(_outputs)', '<@(_inputs)'],
'msvs_cygwin_shell': 0,
},
],
'conditions': [
['OS=="linux"', {
'sources': [
'src/linux/pal.c',
'src/linux/main.c',
],
}],
['OS=="win"', {
'sources': [
'src/win/getopt.c',
'src/win/main.cpp',
'src/win/pal.cpp',
'src/win/stdafx.h',
],
}],
['OS=="mac"', {
'sources': [
'src/mac/main.m',
'src/mac/pal.m',
],
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
'$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
'$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
],
},
}],
],
'msvs_settings': {
'VCCLCompilerTool': {
'CompileAs': 2, # Compile C as C++, since msvs doesn't support C99
},
'VCLinkerTool': {
'AdditionalDependencies': [
'winmm.lib',
'setupapi.lib',
],
},
},
},
{
'target_name': 'mongoose',
'type': 'static_library',
'sources': [
'third_party/mongoose/mongoose.c',
'third_party/mongoose/mongoose.h',
],
},
],
'target_defaults': {
'default_configuration': 'Debug',
'configurations': {
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'cflags': [ '-g', '-O0' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
'Optimization': 0, # optimizeDisabled (/Od)
},
},
'xcode_settings': {'GCC_OPTIMIZATION_LEVEL': 0 } # -O0 No optimization
},
'Release': {
'defines': [ 'NDEBUG' ],
'cflags': [ '-Os' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
'Optimization': 3, # full optimization (/Ox)
},
},
'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': 's' }, # -Os optimize for size+speed
}
},
'conditions': [
['OS=="linux"', {
'ldflags': [ '-pthread' ],
'link_settings': {
'libraries' : [
'-ldl',
'-lX11',
'-lXtst',
'-lGL',
'-ludev',
'-lXinerama',
],
},
}],
['OS=="win"', {
'defines': [ '_WINDOWS', 'WIN32' ],
}],
['OS=="mac"', {
'xcode_settings': {
'ARCHS': '$(ARCHS_STANDARD_64_BIT)',
},
}],
],
'msvs_settings': {
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
'SubSystem': 2, # Windows
},
},
'xcode_settings': {
# This prevents a silly warning in XCode's UI ("Update project to recommended settings"). Unfortunately there's no way to prevent the warning on 'action' targets; oh well.
'COMBINE_HIDPI_IMAGES': 'YES',
},
},
'conditions': [
['OS=="mac"',
# The XCode project generator automatically adds a bogus "All" target with bad xcode_settings unless we define one here.
{
'targets': [
{
'target_name': 'All',
'type': 'static_library',
},
],
},
],
],
}