blob: 73a217e53461d40cceb39e2fd71ba2ac3a9dd1ce [file] [log] [blame]
benjaminwagner56f6d062016-01-13 10:45:19 -08001################################################################################
2# Skylark macros
3################################################################################
benjaminwagner787ca872015-08-17 12:58:10 -07004
benjaminwagner56f6d062016-01-13 10:45:19 -08005is_bazel = not hasattr(native, "genmpm")
6
7def portable_select(select_dict, bazel_condition, default_condition):
8 """Replaces select() with a Bazel-friendly wrapper.
9
10 Args:
11 select_dict: Dictionary in the same format as select().
12 Returns:
13 If Blaze platform, returns select() using select_dict.
14 If Bazel platform, returns dependencies for condition
15 bazel_condition, or empty list if none specified.
16 """
17 if is_bazel:
18 return select_dict.get(bazel_condition, select_dict[default_condition])
19 else:
20 return select(select_dict)
21
22def skia_select(conditions, results):
23 """Replaces select() for conditions [UNIX, ANDROID, IOS]
24
25 Args:
26 conditions: [CONDITION_UNIX, CONDITION_ANDROID, CONDITION_IOS]
27 results: [RESULT_UNIX, RESULT_ANDROID, RESULT_IOS]
28 Returns:
29 The result matching the platform condition.
30 """
31 if len(conditions) != 3 or len(results) != 3:
32 fail("Must provide exactly 3 conditions and 3 results")
33
34 selector = {}
35 for i in range(3):
36 selector[conditions[i]] = results[i]
37 return portable_select(selector, conditions[2], conditions[0])
38
39def skia_glob(srcs):
40 """Replaces glob() with a version that accepts a struct.
41
42 Args:
43 srcs: struct(include=[], exclude=[])
44 Returns:
45 Equivalent of glob(srcs.include, exclude=srcs.exclude)
46 """
47 if hasattr(srcs, 'include'):
48 if hasattr(srcs, 'exclude'):
49 return native.glob(srcs.include, exclude=srcs.exclude)
50 else:
51 return native.glob(srcs.include)
52 return []
53
54################################################################################
iroth849b1752016-04-11 13:45:51 -070055## PRIVATE_HDRS
56################################################################################
57
58PRIVATE_HDRS_LIST = [
59 "include/private/**/*",
60 "src/utils/SkWhitelistChecksums.cpp",
61]
62
63PRIVATE_HDRS = struct(
64 include = PRIVATE_HDRS_LIST,
65)
66
67################################################################################
benjaminwagner56f6d062016-01-13 10:45:19 -080068## BASE_SRCS
69################################################################################
benjaminwagner787ca872015-08-17 12:58:10 -070070
benjaminwagner39e7aa42015-11-18 13:26:10 -080071# All platform-independent SRCS.
benjaminwagner56f6d062016-01-13 10:45:19 -080072BASE_SRCS_ALL = struct(
73 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -070074 "src/**/*.h",
75 "src/**/*.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -070076
mtkleind55d13a2015-08-18 08:51:49 -070077 # Third Party
benjaminwagner787ca872015-08-17 12:58:10 -070078 "third_party/etc1/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070079 "third_party/etc1/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070080 "third_party/ktx/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070081 "third_party/ktx/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070082 ],
iroth849b1752016-04-11 13:45:51 -070083 exclude = PRIVATE_HDRS_LIST + [
benjaminwagner6f6bef82015-10-15 08:09:44 -070084 # Exclude platform-dependent files.
irothd2ccc772016-01-25 11:24:57 -080085 "src/android/*",
iroth76a12252016-01-07 07:11:39 -080086 "src/codec/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070087 "src/device/xps/*", # Windows-only. Move to ports?
88 "src/doc/*_XPS.cpp", # Windows-only. Move to ports?
benjaminwagner2211a7b2015-12-01 11:12:05 -080089 "src/fonts/SkFontMgr_fontconfig.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070090 "src/gpu/gl/android/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -070091 "src/gpu/gl/egl/*",
benjaminwagneraf3b35e2016-03-28 13:27:28 -070092 "src/gpu/gl/glfw/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -070093 "src/gpu/gl/glx/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070094 "src/gpu/gl/iOS/*",
95 "src/gpu/gl/mac/*",
96 "src/gpu/gl/win/*",
iroth76a12252016-01-07 07:11:39 -080097 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070098 "src/opts/**/*",
99 "src/ports/**/*",
100 "src/utils/android/**/*",
101 "src/utils/mac/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700102 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
103 "src/utils/win/**/*",
104 "src/views/sdl/*",
105 "src/views/win/*",
106 "src/views/unix/*",
107
108 # Exclude multiple definitions.
109 # TODO(mtklein): Move to opts?
benjaminwagnerca26a182016-03-14 15:21:12 -0700110 "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700111 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
112 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
iroth5f0de062016-02-17 12:47:27 -0800113 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700114
115 # Exclude files that don't compile with the current DEFINES.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700116 "src/gpu/gl/mesa/*", # Requires SK_MESA define.
benjaminwagner921e48b2016-07-15 11:27:27 -0700117 "src/svg/**/*", # Depends on XML.
118 "src/xml/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700119
benjaminwagner39e7aa42015-11-18 13:26:10 -0800120 # Conflicting dependencies among Lua versions. See cl/107087297.
121 "src/utils/SkLua*",
122
benjaminwagner6f6bef82015-10-15 08:09:44 -0700123 # Not used.
124 "src/animator/**/*",
125 "src/views/**/*",
egdaniel32119f12016-02-22 10:07:54 -0800126
127 # Currently exclude all vulkan specific files
128 "src/gpu/vk/*",
benjaminwagner2214de42016-07-02 05:12:46 -0700129 "src/sksl/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700130 ],
131)
132
133# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800134BASE_SRCS_UNIX = struct(
135 include = [
irothd2ccc772016-01-25 11:24:57 -0800136 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800137 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800138 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth5f0de062016-02-17 12:47:27 -0800139 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800140 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700141 "src/opts/**/*.cpp",
142 "src/opts/**/*.h",
143 "src/ports/**/*.cpp",
144 "src/ports/**/*.h",
145 ],
146 exclude = [
147 "src/opts/*arm*",
148 "src/opts/*mips*",
149 "src/opts/*NEON*",
150 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700151 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700152 "src/opts/*SSSE3*",
153 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700154 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700155 "src/opts/*SSE4*",
156 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800157 # Included in :opts_avx or :opts_avx2
158 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700159 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700160 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700161 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800162 "src/ports/*CG*",
msarettfc0b6d12016-03-17 13:50:17 -0700163 "src/ports/*WIC*",
mtklein3f193a92016-03-10 08:52:05 -0800164 "src/ports/*android*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700165 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700166 "src/ports/*mac*",
167 "src/ports/*mozalloc*",
168 "src/ports/*nacl*",
169 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800170 "src/ports/SkFontConfigInterface_direct_factory.cpp",
171 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700172 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700173 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700174 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800175 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800176 "src/ports/SkFontMgr_fontconfig_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700177 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700178 "src/ports/SkImageGenerator_none.cpp",
179 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700180 ],
181)
182
benjaminwagner86ea33e2015-10-26 10:46:25 -0700183# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800184BASE_SRCS_ANDROID = struct(
185 include = [
irothd2ccc772016-01-25 11:24:57 -0800186 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800187 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800188 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800189 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700190 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700191 "src/opts/**/*.cpp",
192 "src/opts/**/*.h",
193 "src/ports/**/*.cpp",
194 "src/ports/**/*.h",
195 ],
196 exclude = [
197 "src/opts/*mips*",
198 "src/opts/*SSE2*",
199 "src/opts/*SSSE3*",
200 "src/opts/*ssse3*",
201 "src/opts/*SSE4*",
202 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800203 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700204 "src/opts/*x86*",
205 "src/opts/SkBitmapProcState_opts_none.cpp",
206 "src/opts/SkBlitMask_opts_none.cpp",
207 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800208 "src/ports/*CG*",
mtklein3f193a92016-03-10 08:52:05 -0800209 "src/ports/*FontConfig*",
msarettfc0b6d12016-03-17 13:50:17 -0700210 "src/ports/*WIC*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700211 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700212 "src/ports/*fontconfig*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700213 "src/ports/*mac*",
214 "src/ports/*mozalloc*",
215 "src/ports/*nacl*",
216 "src/ports/*win*",
217 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800218 "src/ports/SkFontConfigInterface_direct_factory.cpp",
219 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700220 "src/ports/SkFontMgr_custom_directory_factory.cpp",
221 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700222 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700223 "src/ports/SkFontMgr_empty_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700224 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700225 "src/ports/SkImageGenerator_none.cpp",
226 "src/ports/SkTLS_none.cpp",
227 ],
228)
229
iroth8b99ef42015-11-02 11:11:21 -0800230# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800231BASE_SRCS_IOS = struct(
232 include = [
msarett2775cf52016-02-17 14:14:25 -0800233 "src/android/*",
234 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800235 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
236 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800237 "src/opts/**/*.cpp",
238 "src/opts/**/*.h",
239 "src/ports/**/*.cpp",
240 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800241 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800242 ],
243 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800244 "src/codec/*Gif*.cpp",
245 "src/codec/*Ico*.cpp",
246 "src/codec/*Jpeg*.cpp",
247 "src/codec/*Webp*.cpp",
248 "src/codec/*Png*",
249 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800250 "src/opts/*mips*",
251 "src/opts/*NEON*",
252 "src/opts/*neon*",
253 "src/opts/*SSE2*",
254 "src/opts/*SSSE3*",
255 "src/opts/*ssse3*",
256 "src/opts/*SSE4*",
257 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800258 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800259 "src/opts/*x86*",
260 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800261 "src/opts/SkBlitMask_opts_arm*.cpp",
262 "src/opts/SkBlitRow_opts_arm*.cpp",
mtklein3f193a92016-03-10 08:52:05 -0800263 "src/ports/*CG*",
264 "src/ports/*FontConfig*",
265 "src/ports/*FreeType*",
msarettfc0b6d12016-03-17 13:50:17 -0700266 "src/ports/*WIC*",
iroth8b99ef42015-11-02 11:11:21 -0800267 "src/ports/*android*",
268 "src/ports/*chromium*",
269 "src/ports/*fontconfig*",
iroth8b99ef42015-11-02 11:11:21 -0800270 "src/ports/*mozalloc*",
271 "src/ports/*nacl*",
272 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800273 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800274 "src/ports/SkFontConfigInterface_direct_factory.cpp",
275 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800276 "src/ports/SkFontMgr_custom_directory_factory.cpp",
277 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700278 "src/ports/SkFontMgr_custom_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800279 "src/ports/SkFontMgr_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800280 "src/ports/SkImageGenerator_none.cpp",
281 "src/ports/SkTLS_none.cpp",
282 ],
283)
284
benjaminwagner56f6d062016-01-13 10:45:19 -0800285################################################################################
286## SSSE3/SSE4/AVX/AVX2 SRCS
287################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700288
benjaminwagner56f6d062016-01-13 10:45:19 -0800289SSSE3_SRCS = struct(
290 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700291 "src/opts/*SSSE3*.cpp",
292 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800293 ],
294)
mtkleind55d13a2015-08-18 08:51:49 -0700295
benjaminwagner56f6d062016-01-13 10:45:19 -0800296SSE4_SRCS = struct(
297 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700298 "src/opts/*SSE4*.cpp",
299 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800300 ],
301)
benjaminwagner787ca872015-08-17 12:58:10 -0700302
benjaminwagner56f6d062016-01-13 10:45:19 -0800303AVX_SRCS = struct(
304 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800305 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800306 ],
307)
mtkleinf6d8d282015-12-17 10:18:04 -0800308
benjaminwagner56f6d062016-01-13 10:45:19 -0800309AVX2_SRCS = struct(
310 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800311 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800312 ],
313)
mtkleinf6d8d282015-12-17 10:18:04 -0800314
benjaminwagner56f6d062016-01-13 10:45:19 -0800315################################################################################
316## BASE_HDRS
317################################################################################
318
319BASE_HDRS = struct(
320 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700321 "include/**/*.h",
322 ],
iroth849b1752016-04-11 13:45:51 -0700323 exclude = PRIVATE_HDRS_LIST + [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700324 # Not used.
325 "include/animator/**/*",
326 "include/views/**/*",
benjaminwagner89061ed2016-01-25 09:29:08 -0800327 ],
328)
benjaminwagner787ca872015-08-17 12:58:10 -0700329
benjaminwagner56f6d062016-01-13 10:45:19 -0800330################################################################################
331## BASE_DEPS
332################################################################################
333
334BASE_DEPS_ALL = []
335
benjaminwagner39e7aa42015-11-18 13:26:10 -0800336BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800337 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800338 ":opts_sse4",
339 ":opts_avx",
340 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800341]
342
343BASE_DEPS_ANDROID = []
344
345BASE_DEPS_IOS = []
346
benjaminwagner56f6d062016-01-13 10:45:19 -0800347################################################################################
348## INCLUDES
349################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800350
benjaminwagner787ca872015-08-17 12:58:10 -0700351# Includes needed by Skia implementation. Not public includes.
352INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800353 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700354 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800355 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700356 "include/codec",
357 "include/config",
358 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700359 "include/effects",
360 "include/gpu",
361 "include/images",
362 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700363 "include/pipe",
364 "include/ports",
365 "include/private",
366 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800367 "include/utils/mac",
368 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700369 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700370 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800371 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700372 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700373 "src/gpu",
374 "src/image",
375 "src/lazy",
376 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800377 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700378 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700379 "src/sfnt",
380 "src/utils",
381 "third_party/etc1",
382 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800383]
benjaminwagner787ca872015-08-17 12:58:10 -0700384
benjaminwagner56f6d062016-01-13 10:45:19 -0800385################################################################################
386## DM_SRCS
387################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700388
benjaminwagner56f6d062016-01-13 10:45:19 -0800389DM_SRCS_ALL = struct(
390 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700391 "dm/*.cpp",
392 "dm/*.h",
393 "gm/*.c",
394 "gm/*.cpp",
395 "gm/*.h",
396 "tests/*.cpp",
397 "tests/*.h",
398 "tools/CrashHandler.cpp",
399 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700400 "tools/ProcStats.cpp",
401 "tools/ProcStats.h",
402 "tools/Resources.cpp",
403 "tools/Resources.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700404 "tools/flags/*.cpp",
405 "tools/flags/*.h",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700406 "tools/gpu/**/*.cpp",
407 "tools/gpu/**/*.h",
brianosman6d3119c2016-04-19 19:41:54 -0700408 "tools/picture_utils.cpp",
mtkleine1fc4522016-02-09 12:32:52 -0800409 "tools/random_parse_path.cpp",
410 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700411 "tools/sk_tool_utils.cpp",
412 "tools/sk_tool_utils.h",
413 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700414 "tools/timer/*.cpp",
415 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700416 ],
417 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700418 "dm/DMSrcSinkAndroid.cpp", # Android-only.
419 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
420 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700421 "tests/skia_test.cpp", # Old main.
422 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner2214de42016-07-02 05:12:46 -0700423 "tests/SkSLErrorTest.cpp", # Excluded along with Vulkan.
benjaminwagner921e48b2016-07-15 11:27:27 -0700424 "tests/SVGDeviceTest.cpp",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700425 "tools/gpu/gl/angle/*",
426 "tools/gpu/gl/command_buffer/*",
427 "tools/gpu/gl/egl/*",
428 "tools/gpu/gl/glx/*",
429 "tools/gpu/gl/iOS/*",
430 "tools/gpu/gl/mac/*",
431 "tools/gpu/gl/mesa/*",
432 "tools/gpu/gl/win/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700433 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700434 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700435 ],
436)
437
benjaminwagner38d68bc2016-04-01 05:00:51 -0700438DM_SRCS_UNIX = struct(
439 include = [
440 "tools/gpu/gl/CreatePlatformGLContext_none.cpp",
441 ],
442)
benjaminwagner86ea33e2015-10-26 10:46:25 -0700443
benjaminwagner56f6d062016-01-13 10:45:19 -0800444DM_SRCS_ANDROID = struct(
445 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700446 # Depends on Android HWUI library that is not available in google3.
447 #"dm/DMSrcSinkAndroid.cpp",
448 "tests/FontMgrAndroidParserTest.cpp",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700449 # TODO(benjaminwagner): Figure out how to compile with EGL.
450 "tools/gpu/gl/CreatePlatformGLContext_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700451 ],
452)
453
benjaminwagner38d68bc2016-04-01 05:00:51 -0700454DM_SRCS_IOS = struct(
455 include = [
456 "tools/gpu/iOS/CreatePlatformGLContext_iOS.cpp",
457 ],
458)
benjaminwagner56f6d062016-01-13 10:45:19 -0800459
460################################################################################
461## DM_INCLUDES
462################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700463
benjaminwagner6f6bef82015-10-15 08:09:44 -0700464DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800465 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700466 "gm",
467 "src/codec",
468 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800469 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700470 "src/fonts",
471 "src/pathops",
472 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700473 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800474 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700475 "tests",
476 "tools",
477 "tools/flags",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700478 "tools/gpu",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700479 "tools/timer",
480]
481
benjaminwagner56f6d062016-01-13 10:45:19 -0800482################################################################################
483## DM_ARGS
484################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700485
benjaminwagner83906ae2016-05-01 15:02:25 -0700486def DM_ARGS(base_dir, asan):
487 source = ["tests", "gm", "image"]
488 # TODO(benjaminwagner): f16 and serialize-8888 fail.
489 config = ["565", "8888", "pdf", "srgb", "tiles_rt", "pic"]
490 # TODO(mtklein): maybe investigate why these fail?
491 match = [
492 "~Canvas",
493 "~Codec",
494 "~Codec_Dimensions",
495 "~Codec_stripes",
496 "~FontMgr",
497 "~PaintBreakText",
498 "~RecordDraw_TextBounds",
499 "~Scalar",
500 "~skps",
501 "~Stream",
502 ]
503 if asan:
504 # Running all sources and configs under ASAN causes the test to exceed
505 # "large" size and time out.
506 source = ["tests", "gm"]
507 config = ["8888"]
508 match += [
509 "~clippedcubic2",
510 "~conicpaths",
511 "~gradients_2pt_conical",
512 "~Math",
513 "~Matrix",
514 "~PathOpsCubic",
benjaminwagnerb5188622016-06-29 10:26:44 -0700515 "~PathOpsFailOp",
caryclark523e76d2016-07-19 12:27:32 -0700516 "~PathOpsOpCubicsThreaded",
benjaminwagner83906ae2016-05-01 15:02:25 -0700517 "~PathOpsOpLoopsThreaded",
518 "~PathOpsSimplify",
519 "~PathOpsTightBoundsQuads",
520 "~Point",
benjaminwagner56f6d062016-01-13 10:45:19 -0800521 ]
benjaminwagner83906ae2016-05-01 15:02:25 -0700522 return [
523 "--src %s" % " ".join(source),
524 "--config %s" % " ".join(config),
525 "--verbose",
526 "--match %s" % " ".join(match),
527 "--resourcePath %s/resources" % base_dir,
528 "--images %s/resources" % base_dir,
529 ]
benjaminwagner56f6d062016-01-13 10:45:19 -0800530
531################################################################################
532## COPTS
533################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800534
benjaminwagner86ea33e2015-10-26 10:46:25 -0700535COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700536 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700537 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700538]
539
benjaminwagner56f6d062016-01-13 10:45:19 -0800540COPTS_ANDROID = ["-mfpu=neon"]
541
542COPTS_IOS = []
543
544COPTS_ALL = []
545
546################################################################################
547## DEFINES
548################################################################################
549
550DEFINES_UNIX = [
scroggo7732c0c2016-06-22 07:25:16 -0700551 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800552 "SK_BUILD_FOR_UNIX",
553 "SK_SAMPLES_FOR_X",
554 "SK_SFNTLY_SUBSETTER",
benjaminwagner186e0b92016-02-11 16:00:24 -0800555 "SK_CODEC_DECODES_RAW",
msarettad3a5c62016-05-06 07:21:26 -0700556 "SK_HAS_GIF_LIBRARY",
557 "SK_HAS_JPEG_LIBRARY",
scroggoe6939c12016-06-21 14:13:40 -0700558 "SK_HAS_PNG_LIBRARY",
scroggo7732c0c2016-06-22 07:25:16 -0700559 "SK_HAS_WEBP_LIBRARY",
msarett7f119ca2016-07-19 10:48:58 -0700560 "TURBO_HAS_CROP",
561 "TURBO_HAS_SKIP",
562 "TURBO_HAS_565",
benjaminwagner56f6d062016-01-13 10:45:19 -0800563]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700564
565DEFINES_ANDROID = [
566 "SK_BUILD_FOR_ANDROID",
benjaminwagner186e0b92016-02-11 16:00:24 -0800567 "SK_CODEC_DECODES_RAW",
msarettad3a5c62016-05-06 07:21:26 -0700568 "SK_HAS_GIF_LIBRARY",
569 "SK_HAS_JPEG_LIBRARY",
scroggoe6939c12016-06-21 14:13:40 -0700570 "SK_HAS_PNG_LIBRARY",
scroggo7732c0c2016-06-22 07:25:16 -0700571 "SK_HAS_WEBP_LIBRARY",
msarett7f119ca2016-07-19 10:48:58 -0700572 "TURBO_HAS_CROP",
573 "TURBO_HAS_SKIP",
574 "TURBO_HAS_565",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700575]
576
iroth8b99ef42015-11-02 11:11:21 -0800577DEFINES_IOS = [
578 "SK_BUILD_FOR_IOS",
sdefresnee3fa8112016-06-01 07:08:56 -0700579 "SK_BUILD_NO_OPTS",
iroth8b99ef42015-11-02 11:11:21 -0800580 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800581 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800582]
583
benjaminwagner86ea33e2015-10-26 10:46:25 -0700584DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700585 # Chrome DEFINES.
586 "SK_USE_FLOATBITS",
587 "SK_USE_FREETYPE_EMBOLDEN",
588 # Turn on a few Google3-specific build fixes.
589 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700590 # Staging flags for API changes
benjaminwagnerbddb3722016-07-22 06:19:21 -0700591 "SK_SUPPORT_LEGACY_ACCESSBITMAP",
reedd053ce92016-03-22 10:17:23 -0700592 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
593 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
benjaminwagnerbddb3722016-07-22 06:19:21 -0700594 "SK_SUPPORT_LEGACY_IMAGEFACTORY",
benjaminwagner31dcc2a2016-04-01 06:54:34 -0700595 "SK_SUPPORT_LEGACY_IMAGEFILTER_PTR",
benjaminwagnerbddb3722016-07-22 06:19:21 -0700596 "SK_SUPPORT_LEGACY_MASKFILTER_PTR",
benjaminwagner31dcc2a2016-04-01 06:54:34 -0700597 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
598 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
599 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
fmalita41c40962016-03-24 11:05:28 -0700600 "SK_SUPPORT_LEGACY_PICTURE_PTR",
bungeman13b9c952016-05-12 10:09:30 -0700601 "SK_SUPPORT_LEGACY_TYPEFACE_PTR",
benjaminwagnerbddb3722016-07-22 06:19:21 -0700602 "SK_SUPPORT_LEGACY_XFERMODE_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700603]
604
benjaminwagner56f6d062016-01-13 10:45:19 -0800605################################################################################
606## LINKOPTS
607################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700608
benjaminwagner56f6d062016-01-13 10:45:19 -0800609LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700610
benjaminwagner56f6d062016-01-13 10:45:19 -0800611LINKOPTS_ANDROID = [
612 "-lEGL",
613]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700614
benjaminwagner56f6d062016-01-13 10:45:19 -0800615LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700616
benjaminwagner56f6d062016-01-13 10:45:19 -0800617LINKOPTS_ALL = [
618 "-ldl",
619]