This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
/
brightray.gypi
361 lines (360 loc) · 13.2 KB
/
brightray.gypi
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
{
'includes': [
'vendor/download/libchromiumcontent/filenames.gypi',
],
'variables': {
'libchromiumcontent_component%': 1,
'pkg-config%': 'pkg-config',
'conditions': [
# The "libchromiumcontent_component" is defined when calling "gyp".
['libchromiumcontent_component', {
'libchromiumcontent_dir%': '<(libchromiumcontent_shared_libraries_dir)',
'libchromiumcontent_libraries%': '<(libchromiumcontent_shared_libraries)',
'libchromiumcontent_v8_libraries%': '<(libchromiumcontent_shared_v8_libraries)',
}, {
'libchromiumcontent_dir%': '<(libchromiumcontent_static_libraries_dir)',
'libchromiumcontent_libraries%': '<(libchromiumcontent_static_libraries)',
'libchromiumcontent_v8_libraries%': '<(libchromiumcontent_static_v8_libraries)',
}],
],
},
'target_defaults': {
'includes': [
# Rules for excluding e.g. foo_win.cc from the build on non-Windows.
'filename_rules.gypi',
],
# Putting this in "configurations" will make overrides not working.
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'ARCHS': ['x86_64'],
'COMBINE_HIDPI_IMAGES': 'YES',
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
'GCC_ENABLE_CPP_RTTI': 'NO',
'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
'MACOSX_DEPLOYMENT_TARGET': '10.9',
'RUN_CLANG_STATIC_ANALYZER': 'YES',
'USE_HEADER_MAP': 'NO',
},
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1',
},
'msvs_system_include_dirs': [
'$(VSInstallDir)/VC/atlmfc/include',
],
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': ['/MP'],
'MinimalRebuild': 'false',
'BufferSecurityCheck': 'true',
'EnableFunctionLevelLinking': 'true',
'RuntimeTypeInfo': 'false',
'WarningLevel': '4',
'WarnAsError': 'true',
'DebugInformationFormat': '3',
# Programs that use the Standard C++ library must be compiled with
# C++
# exception handling enabled.
# http://support.microsoft.com/kb/154419
'ExceptionHandling': 1,
},
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
'MapFileName': '$(OutDir)\\$(TargetName).map',
'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
'LargeAddressAware': '2',
'AdditionalOptions': [
# ATL 8.0 included in WDK 7.1 makes the linker to generate
# following
# warnings:
# - warning LNK4254: section 'ATL' (50000040) merged into
# '.rdata' (40000040) with different attributes
# - warning LNK4078: multiple 'ATL' sections found with
# different attributes
'/ignore:4254',
'/ignore:4078',
# views_chromiumcontent.lib generates this warning because it's
# symobls are defined as dllexport but used as static library:
# - warning LNK4217: locally defined symbol imported in function
# - warning LNK4049: locally defined symbol imported
'/ignore:4217',
'/ignore:4049',
],
},
},
'configurations': {
# The "Debug" and "Release" configurations are not actually used.
'Debug': {},
'Release': {},
'Common_Base': {
'abstract': 1,
'defines': [
# We are using Release version libchromiumcontent:
'NDEBUG',
# Needed by gin:
'V8_USE_EXTERNAL_STARTUP_DATA',
# From skia_for_chromium_defines.gypi:
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
'SK_SUPPORT_LEGACY_BITMAP_CONFIG',
'SK_SUPPORT_LEGACY_DEVICE_VIRTUAL_ISOPAQUE',
'SK_SUPPORT_LEGACY_N32_NAME',
'SK_SUPPORT_LEGACY_SETCONFIG',
'SK_IGNORE_ETC1_SUPPORT',
'SK_IGNORE_GPU_DITHER',
# NACL is not enabled:
'DISABLE_NACL',
],
'conditions': [
['OS!="mac"', {
'defines': [
'TOOLKIT_VIEWS',
'USE_AURA',
],
}],
['OS in ["mac", "win"]', {
'defines': [
'USE_OPENSSL',
],
}, {
'defines': [
'USE_X11',
# "use_nss_certs" is set to 1 in libchromiumcontent.
'USE_NSS_CERTS',
'USE_NSS', # deprecated after Chrome 45.
],
}],
['OS=="linux"', {
'defines': [
'_LARGEFILE_SOURCE',
'_LARGEFILE64_SOURCE',
'_FILE_OFFSET_BITS=64',
],
'cflags_cc': [
'-D__STRICT_ANSI__',
'-fno-rtti',
],
}], # OS=="linux"
['OS=="mac"', {
'defines': [
# The usage of "webrtc/modules/desktop_capture/desktop_capture_options.h"
# is required to see this macro.
'WEBRTC_MAC',
],
}], # OS=="mac"
['OS=="win"', {
'include_dirs': [
'<(libchromiumcontent_src_dir)/third_party/wtl/include',
],
'defines': [
'_WIN32_WINNT=0x0602',
'WINVER=0x0602',
'WIN32',
'_WINDOWS',
'NOMINMAX',
'PSAPI_VERSION=1',
'_CRT_RAND_S',
'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
'WIN32_LEAN_AND_MEAN',
'_ATL_NO_OPENGL',
'_SECURE_ATL',
# The usage of "webrtc/modules/desktop_capture/desktop_capture_options.h"
# is required to see this macro.
'WEBRTC_WIN',
],
'conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
'msvs_settings': {
'VCLinkerTool': {
'MinimumRequiredVersion': '5.02', # Server 2003.
'TargetMachine': '17', # x86 - 64
# Doesn't exist x64 SDK. Should use oleaut32 in any case.
'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
},
'VCLibrarianTool': {
'TargetMachine': '17', # x64
},
},
}],
],
}], # OS=="win"
],
}, # Common_Base
'Debug_Base': {
'abstract': 1,
'defines': [
# Use this instead of "NDEBUG" to determine whether we are in
# Debug build, because "NDEBUG" is already used by Chromium.
'DEBUG',
# Require when using libchromiumcontent.
'COMPONENT_BUILD',
'GURL_DLL',
'SKIA_DLL',
'USING_V8_SHARED',
'WEBKIT_DLL',
],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': '2', # /MD (nondebug DLL)
'Optimization': '0', # 0 = /Od
# See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
'BasicRuntimeChecks': '3', # 3 = all checks enabled, 0 = off
},
},
}, # Debug_Base
'Release_Base': {
'abstract': 1,
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': '0', # /MT (nondebug static)
# 1, optimizeMinSpace, Minimize Size (/O1)
'Optimization': '1',
# 2, favorSize - Favor small code (/Os)
'FavorSizeOrSpeed': '2',
# See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
'InlineFunctionExpansion': '2', # 2 = max
# See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
'OmitFramePointers': 'false',
# The above is not sufficient (http://crbug.com/106711): it
# simply eliminates an explicit "/Oy", but both /O2 and /Ox
# perform FPO regardless, so we must explicitly disable.
# We still want the false setting above to avoid having
# "/Oy /Oy-" and warnings about overriding.
'AdditionalOptions': ['/Oy-'],
},
'VCLinkerTool': {
# Turn off incremental linking to save binary size.
'LinkIncremental': '1', # /INCREMENTAL:NO
},
},
'conditions': [
['OS=="linux"', {
'cflags': [
'-O2',
# Generate symbols, will be stripped later.
'-g',
# Don't emit the GCC version ident directives, they just end up
# in the .comment section taking up binary size.
'-fno-ident',
# Put data and code in their own sections, so that unused symbols
# can be removed at link time with --gc-sections.
'-fdata-sections',
'-ffunction-sections',
],
'ldflags': [
# Specifically tell the linker to perform optimizations.
# See http://lwn.net/Articles/192624/ .
'-Wl,-O1',
'-Wl,--as-needed',
'-Wl,--gc-sections',
],
}], # OS=="linux"
],
}, # Release_Base
'conditions': [
['libchromiumcontent_component', {
'D': {
'inherit_from': ['Common_Base', 'Debug_Base'],
}, # D (Debug)
}, {
'R': {
'inherit_from': ['Common_Base', 'Release_Base'],
}, # R (Release)
}], # libchromiumcontent_component
['OS=="win"', {
'conditions': [
# gyp always assumes "_x64" targets on Windows.
['libchromiumcontent_component', {
'D_x64': {
'inherit_from': ['Common_Base', 'Debug_Base'],
}, # D_x64
}, {
'R_x64': {
'inherit_from': ['Common_Base', 'Release_Base'],
}, # R_x64
}], # libchromiumcontent_component
],
}], # OS=="win"
],
}, # configurations
'target_conditions': [
# Putting this under "configurations" doesn't work.
['libchromiumcontent_component', {
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0',
},
}, { # "Debug_Base"
'xcode_settings': {
'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
'GCC_OPTIMIZATION_LEVEL': '2',
'OTHER_CFLAGS': [
'-fno-inline',
'-fno-omit-frame-pointer',
'-fno-builtin',
'-fno-optimize-sibling-calls',
],
},
}], # "Release_Base"
['OS=="mac" and libchromiumcontent_component==0 and _type in ["executable", "shared_library"]', {
'xcode_settings': {
# Generates symbols and strip the binary.
'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
'DEPLOYMENT_POSTPROCESSING': 'YES',
'STRIP_INSTALLED_PRODUCT': 'YES',
'STRIPFLAGS': '-x',
},
}], # OS=="mac" and libchromiumcontent_component==0 and _type in ["executable", "shared_library"]
['OS=="linux" and target_arch=="ia32" and _toolset=="target"', {
'ldflags': [
# Workaround for linker OOM.
'-Wl,--no-keep-memory',
],
}],
], # target_conditions
# Ignored compiler warnings of Chromium.
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wno-deprecated-declarations',
'-Wno-undefined-var-template', # https://crbug.com/604888
'-Wno-unneeded-internal-declaration',
'-Wno-inconsistent-missing-override',
],
},
}],
['OS=="linux"', {
'cflags': [
'-Wno-inconsistent-missing-override',
'-Wno-undefined-var-template', # https://crbug.com/604888
],
}],
['OS=="win"', {
'msvs_disabled_warnings': [
4100, # unreferenced formal parameter
4121, # alignment of a member was sensitive to packing
4127, # conditional expression is constant
4189, # local variable is initialized but not referenced
4244, # 'initializing' : conversion from 'double' to 'size_t', possible loss of data
4245, # 'initializing' : conversion from 'int' to 'const net::QuicVersionTag', signed/unsigned mismatch
4251, # class 'std::xx' needs to have dll-interface.
4310, # cast truncates constant value
4355, # 'this' : used in base member initializer list
4480, # nonstandard extension used: specifying underlying type for enum
4481, # nonstandard extension used: override specifier 'override'
4510, # default constructor could not be generated
4512, # assignment operator could not be generated
4610, # user defined constructor required
4702, # unreachable code
4819, # The file contains a character that cannot be represented in the current code page
],
}],
], # conditions
}, # target_defaults
}