-
Notifications
You must be signed in to change notification settings - Fork 9
/
BUILD.public
461 lines (421 loc) · 12.1 KB
/
BUILD.public
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# Description:
# Skia graphics library.
#
# Definitions for Google BUILD file.
exports_files(["BUILD.public"])
# All platform-independent SRCS.
BASE_SRCS = glob(
[
"include/private/*.h",
"src/**/*.h",
"src/**/*.cpp",
# Third Party
"third_party/etc1/*.cpp",
"third_party/etc1/*.h",
"third_party/ktx/*.cpp",
"third_party/ktx/*.h",
],
exclude = [
# Exclude platform-dependent files.
"src/device/xps/*", # Windows-only. Move to ports?
"src/doc/*_XPS.cpp", # Windows-only. Move to ports?
"src/fonts/SkFontMgr_fontconfig.cpp",
"src/gpu/gl/android/*",
"src/gpu/gl/egl/*",
"src/gpu/gl/glx/*",
"src/gpu/gl/iOS/*",
"src/gpu/gl/mac/*",
"src/gpu/gl/win/*",
"src/opts/**/*",
"src/ports/**/*",
"src/utils/android/**/*",
"src/utils/mac/**/*",
"src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
"src/utils/win/**/*",
"src/views/sdl/*",
"src/views/win/*",
"src/views/unix/*",
# Exclude multiple definitions.
# TODO(mtklein): Move to opts?
"src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp.
"src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
"src/gpu/gl/GrGLDefaultInterface_native.cpp",
# Exclude files that don't compile with the current DEFINES.
"src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch.
"src/gpu/gl/angle/*", # Requires SK_ANGLE define.
"src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE'
"src/gpu/gl/mesa/*", # Requires SK_MESA define.
"src/svg/parser/*", # Missing SkSVG.h.
# Conflicting dependencies among Lua versions. See cl/107087297.
"src/utils/SkLua*",
# Not used.
"src/animator/**/*",
"src/views/**/*",
"src/xml/SkBML_Verbs.h",
"src/xml/SkBML_XMLParser.cpp",
"src/xml/SkXMLPullParser.cpp",
],
)
# Platform-dependent SRCS for google3-default platform.
BASE_SRCS_UNIX = glob(
[
"src/fonts/SkFontMgr_fontconfig.cpp",
"src/opts/**/*.cpp",
"src/opts/**/*.h",
"src/ports/**/*.cpp",
"src/ports/**/*.h",
],
exclude = [
"src/opts/*arm*",
"src/opts/*mips*",
"src/opts/*NEON*",
"src/opts/*neon*",
# Included in :opts_ssse3 library.
"src/opts/*SSSE3*",
"src/opts/*ssse3*",
# Included in :opts_sse4 library.
"src/opts/*SSE4*",
"src/opts/*sse4*",
"src/opts/SkBitmapProcState_opts_none.cpp",
"src/opts/SkBlitMask_opts_none.cpp",
"src/opts/SkBlitRow_opts_none.cpp",
"src/ports/*android*",
"src/ports/*chromium*",
"src/ports/*mac*",
"src/ports/*mozalloc*",
"src/ports/*nacl*",
"src/ports/*win*",
"src/ports/SkFontConfigInterface_direct_factory.cpp",
"src/ports/SkFontMgr_custom_directory_factory.cpp",
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
"src/ports/SkFontMgr_empty_factory.cpp",
"src/ports/SkFontMgr_fontconfig.cpp",
"src/ports/SkImageDecoder_CG.cpp",
"src/ports/SkFontMgr_fontconfig_factory.cpp",
"src/ports/SkImageDecoder_WIC.cpp",
"src/ports/SkImageDecoder_empty.cpp",
"src/ports/SkImageGenerator_none.cpp",
"src/ports/SkTLS_none.cpp",
],
)
# Platform-dependent SRCS for google3-default Android.
BASE_SRCS_ANDROID = glob(
[
# TODO(benjaminwagner): Figure out how to compile with EGL.
"src/opts/**/*.cpp",
"src/opts/**/*.h",
"src/ports/**/*.cpp",
"src/ports/**/*.h",
],
exclude = [
"src/opts/*mips*",
"src/opts/*SSE2*",
"src/opts/*SSSE3*",
"src/opts/*ssse3*",
"src/opts/*SSE4*",
"src/opts/*sse4*",
"src/opts/*x86*",
"src/opts/SkBitmapProcState_opts_none.cpp",
"src/opts/SkBlitMask_opts_none.cpp",
"src/opts/SkBlitRow_opts_none.cpp",
"src/ports/*chromium*",
"src/ports/*fontconfig*",
"src/ports/*FontConfig*",
"src/ports/*mac*",
"src/ports/*mozalloc*",
"src/ports/*nacl*",
"src/ports/*win*",
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkFontConfigInterface_direct_factory.cpp",
"src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
"src/ports/SkFontMgr_custom_directory_factory.cpp",
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
"src/ports/SkFontMgr_empty_factory.cpp",
"src/ports/SkImageDecoder_CG.cpp",
"src/ports/SkImageDecoder_WIC.cpp",
"src/ports/SkImageDecoder_empty.cpp",
"src/ports/SkImageGenerator_none.cpp",
"src/ports/SkTLS_none.cpp",
],
)
# Platform-dependent SRCS for google3-default iOS.
BASE_SRCS_IOS = glob(
[
"src/opts/**/*.cpp",
"src/opts/**/*.h",
"src/ports/**/*.cpp",
"src/ports/**/*.h",
],
exclude = [
"src/opts/*mips*",
"src/opts/*NEON*",
"src/opts/*neon*",
"src/opts/*SSE2*",
"src/opts/*SSSE3*",
"src/opts/*ssse3*",
"src/opts/*SSE4*",
"src/opts/*sse4*",
"src/opts/*x86*",
"src/opts/SkBitmapProcState_opts_none.cpp",
"src/opts/SkBlitMask_opts_none.cpp",
"src/opts/SkBlitRow_opts_none.cpp",
"src/ports/*android*",
"src/ports/*chromium*",
"src/ports/*fontconfig*",
"src/ports/*FontConfig*",
"src/ports/*FreeType*",
"src/ports/*mozalloc*",
"src/ports/*nacl*",
"src/ports/*win*",
"src/ports/SkDebug_stdio.cpp",
"src/ports/SkFontMgr_custom.cpp",
"src/ports/SkFontConfigInterface_direct_factory.cpp",
"src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
"src/ports/SkFontMgr_custom_directory_factory.cpp",
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
"src/ports/SkFontMgr_empty_factory.cpp",
"src/ports/SkImageDecoder_CG.cpp",
"src/ports/SkImageDecoder_WIC.cpp",
"src/ports/SkImageDecoder_empty.cpp",
"src/ports/SkImageGenerator_none.cpp",
"src/ports/SkTLS_none.cpp",
],
)
BASE_SRCS_PLATFORM = select({
CONDITION_ANDROID: BASE_SRCS_ANDROID,
CONDITION_IOS: BASE_SRCS_IOS,
"//conditions:default": BASE_SRCS_UNIX,
})
SSSE3_SRCS = glob(
[
"src/opts/*SSSE3*.cpp",
"src/opts/*ssse3*.cpp",
],
)
SSE4_SRCS = glob(
[
"src/opts/*SSE4*.cpp",
"src/opts/*sse4*.cpp",
],
)
BASE_HDRS = glob(
[
"include/**/*.h",
],
exclude = [
"include/private/**/*",
# Not used.
"include/animator/**/*",
"include/views/**/*",
"include/xml/SkBML_WXMLParser.h",
"include/xml/SkBML_XMLParser.h",
],
)
# Dependencies.
BASE_DEPS_UNIX = [
":opts_sse4",
":opts_ssse3",
]
BASE_DEPS_ANDROID = []
BASE_DEPS_IOS = []
BASE_DEPS = select({
CONDITION_ANDROID: BASE_DEPS_ANDROID + BASE_EXTERNAL_DEPS_ANDROID,
CONDITION_IOS: BASE_DEPS_IOS + BASE_EXTERNAL_DEPS_IOS,
"//conditions:default": BASE_DEPS_UNIX + BASE_EXTERNAL_DEPS_UNIX,
}) + EXTERNAL_DEPS_ALL
# Includes needed by Skia implementation. Not public includes.
INCLUDES = [
"include/android",
"include/c",
"include/codec",
"include/config",
"include/core",
"include/effects",
"include/gpu",
"include/images",
"include/pathops",
"include/pipe",
"include/ports",
"include/private",
"include/utils",
"include/utils/mac",
"include/utils/win",
"include/svg",
"include/xml",
"src/codec",
"src/core",
"src/gpu",
"src/image",
"src/lazy",
"src/opts",
"src/ports",
"src/pdf",
"src/sfnt",
"src/utils",
"third_party/etc1",
"third_party/ktx",
] + EXTERNAL_INCLUDES
## :dm
# Platform-independent SRCS for DM.
DM_SRCS = glob(
[
"dm/*.cpp",
"dm/*.h",
"gm/*.c",
"gm/*.cpp",
"gm/*.h",
"tests/*.cpp",
"tests/*.h",
"tools/CrashHandler.cpp",
"tools/CrashHandler.h",
"tools/LazyDecodeBitmap.cpp",
"tools/LazyDecodeBitmap.h",
"tools/ProcStats.cpp",
"tools/ProcStats.h",
"tools/Resources.cpp",
"tools/Resources.h",
"tools/SkBitmapRegionCanvas.cpp",
"tools/SkBitmapRegionCanvas.h",
"tools/SkBitmapRegionCodec.cpp",
"tools/SkBitmapRegionCodec.h",
"tools/SkBitmapRegionDecoder.cpp",
"tools/SkBitmapRegionDecoder.h",
"tools/SkBitmapRegionSampler.cpp",
"tools/SkBitmapRegionSampler.h",
"tools/flags/*.cpp",
"tools/flags/*.h",
"tools/sk_tool_utils.cpp",
"tools/sk_tool_utils.h",
"tools/sk_tool_utils_font.cpp",
"tools/timer/*.cpp",
"tools/timer/*.h",
],
exclude = [
"dm/DMSrcSinkAndroid.cpp", # Android-only.
"tests/FontMgrAndroidParserTest.cpp", # Android-only.
"tests/PathOpsSkpClipTest.cpp", # Alternate main.
"tests/skia_test.cpp", # Old main.
"tests/SkpSkGrTest.cpp", # Alternate main.
"tools/timer/SysTimer_mach.cpp",
"tools/timer/SysTimer_windows.cpp",
],
)
DM_SRCS_UNIX = []
DM_SRCS_ANDROID = glob(
[
# Depends on Android HWUI library that is not available in google3.
#"dm/DMSrcSinkAndroid.cpp",
"tests/FontMgrAndroidParserTest.cpp",
],
)
DM_PLATFORM_SRCS = select({
CONDITION_ANDROID: DM_SRCS_ANDROID,
"//conditions:default": DM_SRCS_UNIX,
})
DM_INCLUDES = [
"gm",
"src/codec",
"src/effects",
"src/fonts",
"src/pathops",
"src/pipe/utils",
"src/ports",
"src/utils/debugger",
"tests",
"tools",
"tools/flags",
"tools/timer",
]
COPTS_ANDROID = ["-mfpu=neon"]
COPTS_IOS = []
COPTS_UNIX = [
"-Wno-implicit-fallthrough", # Some intentional fallthrough.
"-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
]
COPTS = select({
CONDITION_ANDROID: COPTS_ANDROID,
CONDITION_IOS: COPTS_IOS,
"//conditions:default": COPTS_UNIX,
})
DEFINES_ANDROID = [
"SK_BUILD_FOR_ANDROID",
# TODO(benjaminwagner): Try to get png library updated?
"SK_PNG_NO_INDEX_SUPPORTED",
]
DEFINES_IOS = [
"SK_BUILD_FOR_IOS",
"SK_IGNORE_ETC1_SUPPORT",
]
DEFINES_UNIX = [
"SK_BUILD_FOR_UNIX",
"SK_SAMPLES_FOR_X",
]
DEFINES_ALL = [
# Chrome DEFINES.
"SK_USE_FLOATBITS",
"SK_USE_FREETYPE_EMBOLDEN",
# Turn on a few Google3-specific build fixes.
"GOOGLE3",
]
DEFINES = select({
CONDITION_ANDROID: DEFINES_ANDROID,
CONDITION_IOS: DEFINES_IOS,
"//conditions:default": DEFINES_UNIX,
}) + DEFINES_ALL
LINKOPTS = select({
CONDITION_ANDROID: [
"-ldl",
"-lEGL",
],
"//conditions:default": ["-ldl"],
})
cc_library(
name = "opts_ssse3",
srcs = SSSE3_SRCS,
copts = COPTS + ["-mssse3"],
defines = DEFINES,
includes = INCLUDES,
deps = EXTERNAL_DEPS_ALL,
)
cc_library(
name = "opts_sse4",
srcs = SSE4_SRCS,
copts = COPTS + ["-msse4"],
defines = DEFINES,
includes = INCLUDES,
deps = EXTERNAL_DEPS_ALL,
)
# If you need Ganesh (GPU) support in Skia, please contact [email protected]
# for help.
cc_library(
name = "skia",
srcs = BASE_SRCS + BASE_SRCS_PLATFORM,
hdrs = BASE_HDRS,
copts = COPTS,
defines = DEFINES,
includes = INCLUDES,
linkopts = LINKOPTS,
visibility = [":skia_clients"],
deps = BASE_DEPS,
alwayslink = 1,
)
cc_test(
name = "dm",
size = "large",
srcs = DM_SRCS + DM_PLATFORM_SRCS,
args = [
"--nogpu",
"--verbose",
# TODO(mtklein): maybe investigate why these fail?
"--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds",
"--resourcePath %s/resources" % BASE_DIR,
"--images %s/resources" % BASE_DIR,
],
copts = COPTS,
data = glob(["resources/**/*"]),
defines = DEFINES,
includes = DM_INCLUDES,
deps = DM_EXTERNAL_DEPS + [
":skia",
] + EXTERNAL_DEPS_ALL,
)