blob: a34f76e896969b090286487e1f5549fa9c27a156 [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
benjaminwagner99fb6702016-07-28 15:12:21 -070058PRIVATE_HDRS_INCLUDE_LIST = [
59 "include/private/**/*.h",
60 "src/**/*.inc",
iroth849b1752016-04-11 13:45:51 -070061]
62
63PRIVATE_HDRS = struct(
benjaminwagner99fb6702016-07-28 15:12:21 -070064 include = PRIVATE_HDRS_INCLUDE_LIST,
65)
66
67ALL_HDRS = struct(
68 include = [
69 "src/**/*.h",
70 "include/**/*.h",
71 ],
iroth849b1752016-04-11 13:45:51 -070072)
73
74################################################################################
benjaminwagner56f6d062016-01-13 10:45:19 -080075## BASE_SRCS
76################################################################################
benjaminwagner787ca872015-08-17 12:58:10 -070077
benjaminwagner39e7aa42015-11-18 13:26:10 -080078# All platform-independent SRCS.
benjaminwagner56f6d062016-01-13 10:45:19 -080079BASE_SRCS_ALL = struct(
80 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -070081 "src/**/*.h",
82 "src/**/*.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -070083
mtkleind55d13a2015-08-18 08:51:49 -070084 # Third Party
benjaminwagner787ca872015-08-17 12:58:10 -070085 "third_party/etc1/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070086 "third_party/etc1/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070087 "third_party/ktx/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070088 "third_party/ktx/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070089 ],
benjaminwagner99fb6702016-07-28 15:12:21 -070090 # Note: PRIVATE_HDRS_INCLUDE_LIST is excluded from BASE_SRCS_ALL here
91 # because they are required to appear in srcs for some rules but hdrs for
92 # other rules. See internal cl/119566959.
93 exclude = PRIVATE_HDRS_INCLUDE_LIST + [
benjaminwagner6f6bef82015-10-15 08:09:44 -070094 # Exclude platform-dependent files.
irothd2ccc772016-01-25 11:24:57 -080095 "src/android/*",
iroth76a12252016-01-07 07:11:39 -080096 "src/codec/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070097 "src/device/xps/*", # Windows-only. Move to ports?
98 "src/doc/*_XPS.cpp", # Windows-only. Move to ports?
99 "src/gpu/gl/android/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700100 "src/gpu/gl/egl/*",
benjaminwagneraf3b35e2016-03-28 13:27:28 -0700101 "src/gpu/gl/glfw/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700102 "src/gpu/gl/glx/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700103 "src/gpu/gl/iOS/*",
104 "src/gpu/gl/mac/*",
105 "src/gpu/gl/win/*",
iroth76a12252016-01-07 07:11:39 -0800106 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700107 "src/opts/**/*",
108 "src/ports/**/*",
109 "src/utils/android/**/*",
110 "src/utils/mac/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700111 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
112 "src/utils/win/**/*",
113 "src/views/sdl/*",
114 "src/views/win/*",
115 "src/views/unix/*",
116
117 # Exclude multiple definitions.
118 # TODO(mtklein): Move to opts?
benjaminwagnerca26a182016-03-14 15:21:12 -0700119 "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700120 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
121 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
iroth5f0de062016-02-17 12:47:27 -0800122 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700123
124 # Exclude files that don't compile with the current DEFINES.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700125 "src/gpu/gl/mesa/*", # Requires SK_MESA define.
benjaminwagner921e48b2016-07-15 11:27:27 -0700126 "src/svg/**/*", # Depends on XML.
127 "src/xml/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700128
benjaminwagner39e7aa42015-11-18 13:26:10 -0800129 # Conflicting dependencies among Lua versions. See cl/107087297.
130 "src/utils/SkLua*",
131
benjaminwagner6f6bef82015-10-15 08:09:44 -0700132 # Not used.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700133 "src/views/**/*",
egdaniel32119f12016-02-22 10:07:54 -0800134
135 # Currently exclude all vulkan specific files
136 "src/gpu/vk/*",
benjaminwagnerc8962512016-09-30 12:06:27 -0700137
138 # Defines main.
139 "src/sksl/SkSLMain.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700140 ],
141)
142
143# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800144BASE_SRCS_UNIX = struct(
145 include = [
irothd2ccc772016-01-25 11:24:57 -0800146 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800147 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800148 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800149 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700150 "src/opts/**/*.cpp",
151 "src/opts/**/*.h",
152 "src/ports/**/*.cpp",
153 "src/ports/**/*.h",
154 ],
155 exclude = [
156 "src/opts/*arm*",
157 "src/opts/*mips*",
158 "src/opts/*NEON*",
159 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700160 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700161 "src/opts/*SSSE3*",
162 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700163 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700164 "src/opts/*SSE4*",
165 "src/opts/*sse4*",
Mike Klein71475052016-09-30 11:34:54 -0400166 # Included in :opts_avx or :opts_hsw
mtkleinf6d8d282015-12-17 10:18:04 -0800167 "src/opts/*avx*",
Mike Klein71475052016-09-30 11:34:54 -0400168 "src/opts/*hsw*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700169 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700170 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700171 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800172 "src/ports/*CG*",
msarettfc0b6d12016-03-17 13:50:17 -0700173 "src/ports/*WIC*",
mtklein3f193a92016-03-10 08:52:05 -0800174 "src/ports/*android*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700175 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700176 "src/ports/*mac*",
177 "src/ports/*mozalloc*",
178 "src/ports/*nacl*",
179 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800180 "src/ports/SkFontConfigInterface_direct_factory.cpp",
181 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700182 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700183 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700184 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800185 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800186 "src/ports/SkFontMgr_fontconfig_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700187 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700188 "src/ports/SkImageGenerator_none.cpp",
189 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700190 ],
191)
192
benjaminwagner86ea33e2015-10-26 10:46:25 -0700193# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800194BASE_SRCS_ANDROID = struct(
195 include = [
irothd2ccc772016-01-25 11:24:57 -0800196 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800197 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800198 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800199 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700200 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700201 "src/opts/**/*.cpp",
202 "src/opts/**/*.h",
203 "src/ports/**/*.cpp",
204 "src/ports/**/*.h",
205 ],
206 exclude = [
207 "src/opts/*mips*",
208 "src/opts/*SSE2*",
209 "src/opts/*SSSE3*",
210 "src/opts/*ssse3*",
211 "src/opts/*SSE4*",
212 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800213 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700214 "src/opts/*x86*",
215 "src/opts/SkBitmapProcState_opts_none.cpp",
216 "src/opts/SkBlitMask_opts_none.cpp",
217 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800218 "src/ports/*CG*",
mtklein3f193a92016-03-10 08:52:05 -0800219 "src/ports/*FontConfig*",
msarettfc0b6d12016-03-17 13:50:17 -0700220 "src/ports/*WIC*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700221 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700222 "src/ports/*fontconfig*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700223 "src/ports/*mac*",
224 "src/ports/*mozalloc*",
225 "src/ports/*nacl*",
226 "src/ports/*win*",
227 "src/ports/SkDebug_stdio.cpp",
228 "src/ports/SkFontMgr_custom_directory_factory.cpp",
229 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700230 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700231 "src/ports/SkFontMgr_empty_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700232 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700233 "src/ports/SkImageGenerator_none.cpp",
234 "src/ports/SkTLS_none.cpp",
235 ],
236)
237
iroth8b99ef42015-11-02 11:11:21 -0800238# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800239BASE_SRCS_IOS = struct(
240 include = [
msarett2775cf52016-02-17 14:14:25 -0800241 "src/android/*",
242 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800243 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
244 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800245 "src/opts/**/*.cpp",
246 "src/opts/**/*.h",
247 "src/ports/**/*.cpp",
248 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800249 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800250 ],
251 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800252 "src/codec/*Gif*.cpp",
253 "src/codec/*Ico*.cpp",
254 "src/codec/*Jpeg*.cpp",
255 "src/codec/*Webp*.cpp",
256 "src/codec/*Png*",
257 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800258 "src/opts/*mips*",
259 "src/opts/*NEON*",
260 "src/opts/*neon*",
261 "src/opts/*SSE2*",
262 "src/opts/*SSSE3*",
263 "src/opts/*ssse3*",
264 "src/opts/*SSE4*",
265 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800266 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800267 "src/opts/*x86*",
268 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800269 "src/opts/SkBlitMask_opts_arm*.cpp",
270 "src/opts/SkBlitRow_opts_arm*.cpp",
mtklein3f193a92016-03-10 08:52:05 -0800271 "src/ports/*CG*",
272 "src/ports/*FontConfig*",
273 "src/ports/*FreeType*",
msarettfc0b6d12016-03-17 13:50:17 -0700274 "src/ports/*WIC*",
iroth8b99ef42015-11-02 11:11:21 -0800275 "src/ports/*android*",
276 "src/ports/*chromium*",
277 "src/ports/*fontconfig*",
iroth8b99ef42015-11-02 11:11:21 -0800278 "src/ports/*mozalloc*",
279 "src/ports/*nacl*",
280 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800281 "src/ports/SkFontMgr_custom.cpp",
282 "src/ports/SkFontMgr_custom_directory_factory.cpp",
283 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700284 "src/ports/SkFontMgr_custom_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800285 "src/ports/SkFontMgr_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800286 "src/ports/SkImageGenerator_none.cpp",
287 "src/ports/SkTLS_none.cpp",
288 ],
289)
290
benjaminwagner56f6d062016-01-13 10:45:19 -0800291################################################################################
Mike Kleinc8deb022016-09-30 12:36:55 -0400292## SSSE3/SSE4/AVX/HSW SRCS
benjaminwagner56f6d062016-01-13 10:45:19 -0800293################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700294
benjaminwagner56f6d062016-01-13 10:45:19 -0800295SSSE3_SRCS = struct(
296 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700297 "src/opts/*SSSE3*.cpp",
298 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800299 ],
300)
mtkleind55d13a2015-08-18 08:51:49 -0700301
benjaminwagner56f6d062016-01-13 10:45:19 -0800302SSE4_SRCS = struct(
303 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700304 "src/opts/*SSE4*.cpp",
305 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800306 ],
307)
benjaminwagner787ca872015-08-17 12:58:10 -0700308
benjaminwagner56f6d062016-01-13 10:45:19 -0800309AVX_SRCS = struct(
310 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800311 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800312 ],
313)
mtkleinf6d8d282015-12-17 10:18:04 -0800314
Mike Klein78d5a3b2016-09-30 10:48:01 -0400315HSW_SRCS = struct(
316 include = [
317 "src/opts/*_hsw.cpp",
318 ],
319)
320
benjaminwagner56f6d062016-01-13 10:45:19 -0800321################################################################################
322## BASE_HDRS
323################################################################################
324
325BASE_HDRS = struct(
326 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700327 "include/**/*.h",
328 ],
benjaminwagner99fb6702016-07-28 15:12:21 -0700329 exclude = PRIVATE_HDRS_INCLUDE_LIST + [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700330 # Not used.
331 "include/animator/**/*",
332 "include/views/**/*",
benjaminwagner89061ed2016-01-25 09:29:08 -0800333 ],
334)
benjaminwagner787ca872015-08-17 12:58:10 -0700335
benjaminwagner56f6d062016-01-13 10:45:19 -0800336################################################################################
337## BASE_DEPS
338################################################################################
339
340BASE_DEPS_ALL = []
341
benjaminwagner39e7aa42015-11-18 13:26:10 -0800342BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800343 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800344 ":opts_sse4",
345 ":opts_avx",
Mike Kleinc8deb022016-09-30 12:36:55 -0400346 ":opts_hsw",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800347]
348
349BASE_DEPS_ANDROID = []
350
351BASE_DEPS_IOS = []
352
benjaminwagner56f6d062016-01-13 10:45:19 -0800353################################################################################
354## INCLUDES
355################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800356
benjaminwagner787ca872015-08-17 12:58:10 -0700357# Includes needed by Skia implementation. Not public includes.
358INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800359 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700360 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800361 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700362 "include/codec",
363 "include/config",
364 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700365 "include/effects",
366 "include/gpu",
367 "include/images",
368 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700369 "include/pipe",
370 "include/ports",
371 "include/private",
372 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800373 "include/utils/mac",
374 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700375 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700376 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800377 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700378 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700379 "src/gpu",
380 "src/image",
381 "src/lazy",
382 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800383 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700384 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700385 "src/sfnt",
benjaminwagnerc8962512016-09-30 12:06:27 -0700386 "src/sksl",
benjaminwagner787ca872015-08-17 12:58:10 -0700387 "src/utils",
388 "third_party/etc1",
389 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800390]
benjaminwagner787ca872015-08-17 12:58:10 -0700391
benjaminwagner56f6d062016-01-13 10:45:19 -0800392################################################################################
393## DM_SRCS
394################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700395
benjaminwagner56f6d062016-01-13 10:45:19 -0800396DM_SRCS_ALL = struct(
397 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700398 "dm/*.cpp",
399 "dm/*.h",
400 "gm/*.c",
401 "gm/*.cpp",
402 "gm/*.h",
403 "tests/*.cpp",
404 "tests/*.h",
benjaminwagner99fb6702016-07-28 15:12:21 -0700405 "tools/BigPathBench.inc",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700406 "tools/CrashHandler.cpp",
407 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700408 "tools/ProcStats.cpp",
409 "tools/ProcStats.h",
410 "tools/Resources.cpp",
411 "tools/Resources.h",
benjaminwagner99fb6702016-07-28 15:12:21 -0700412 "tools/SkJSONCPP.h",
413 "tools/UrlDataManager.cpp",
414 "tools/UrlDataManager.h",
415 "tools/debugger/*.cpp",
416 "tools/debugger/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700417 "tools/flags/*.cpp",
418 "tools/flags/*.h",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700419 "tools/gpu/**/*.cpp",
420 "tools/gpu/**/*.h",
brianosman6d3119c2016-04-19 19:41:54 -0700421 "tools/picture_utils.cpp",
benjaminwagner99fb6702016-07-28 15:12:21 -0700422 "tools/picture_utils.h",
mtkleine1fc4522016-02-09 12:32:52 -0800423 "tools/random_parse_path.cpp",
424 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700425 "tools/sk_tool_utils.cpp",
426 "tools/sk_tool_utils.h",
benjaminwagner99fb6702016-07-28 15:12:21 -0700427 "tools/sk_tool_utils_flags.h",
benjaminwagner32885142015-10-24 07:55:31 -0700428 "tools/sk_tool_utils_font.cpp",
benjaminwagner99fb6702016-07-28 15:12:21 -0700429 "tools/test_font_monospace.inc",
430 "tools/test_font_sans_serif.inc",
431 "tools/test_font_serif.inc",
432 "tools/test_font_index.inc",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700433 "tools/timer/*.cpp",
434 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700435 ],
436 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700437 "dm/DMSrcSinkAndroid.cpp", # Android-only.
438 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
439 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700440 "tests/skia_test.cpp", # Old main.
441 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner921e48b2016-07-15 11:27:27 -0700442 "tests/SVGDeviceTest.cpp",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700443 "tools/gpu/gl/angle/*",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700444 "tools/gpu/gl/egl/*",
445 "tools/gpu/gl/glx/*",
446 "tools/gpu/gl/iOS/*",
447 "tools/gpu/gl/mac/*",
448 "tools/gpu/gl/mesa/*",
449 "tools/gpu/gl/win/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700450 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700451 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700452 ],
453)
454
benjaminwagner38d68bc2016-04-01 05:00:51 -0700455DM_SRCS_UNIX = struct(
456 include = [
457 "tools/gpu/gl/CreatePlatformGLContext_none.cpp",
458 ],
459)
benjaminwagner86ea33e2015-10-26 10:46:25 -0700460
benjaminwagner56f6d062016-01-13 10:45:19 -0800461DM_SRCS_ANDROID = struct(
462 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700463 # Depends on Android HWUI library that is not available in google3.
464 #"dm/DMSrcSinkAndroid.cpp",
465 "tests/FontMgrAndroidParserTest.cpp",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700466 # TODO(benjaminwagner): Figure out how to compile with EGL.
467 "tools/gpu/gl/CreatePlatformGLContext_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700468 ],
469)
470
benjaminwagner38d68bc2016-04-01 05:00:51 -0700471DM_SRCS_IOS = struct(
472 include = [
473 "tools/gpu/iOS/CreatePlatformGLContext_iOS.cpp",
474 ],
475)
benjaminwagner56f6d062016-01-13 10:45:19 -0800476
477################################################################################
478## DM_INCLUDES
479################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700480
benjaminwagner6f6bef82015-10-15 08:09:44 -0700481DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800482 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700483 "gm",
484 "src/codec",
485 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800486 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700487 "src/fonts",
488 "src/pathops",
489 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700490 "src/ports",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700491 "tests",
492 "tools",
benjaminwagner99fb6702016-07-28 15:12:21 -0700493 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700494 "tools/flags",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700495 "tools/gpu",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700496 "tools/timer",
497]
498
benjaminwagner56f6d062016-01-13 10:45:19 -0800499################################################################################
500## DM_ARGS
501################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700502
benjaminwagner83906ae2016-05-01 15:02:25 -0700503def DM_ARGS(base_dir, asan):
504 source = ["tests", "gm", "image"]
505 # TODO(benjaminwagner): f16 and serialize-8888 fail.
506 config = ["565", "8888", "pdf", "srgb", "tiles_rt", "pic"]
507 # TODO(mtklein): maybe investigate why these fail?
508 match = [
509 "~Canvas",
510 "~Codec",
511 "~Codec_Dimensions",
512 "~Codec_stripes",
513 "~FontMgr",
514 "~PaintBreakText",
515 "~RecordDraw_TextBounds",
516 "~Scalar",
517 "~skps",
518 "~Stream",
519 ]
520 if asan:
521 # Running all sources and configs under ASAN causes the test to exceed
522 # "large" size and time out.
523 source = ["tests", "gm"]
524 config = ["8888"]
525 match += [
526 "~clippedcubic2",
527 "~conicpaths",
528 "~gradients_2pt_conical",
529 "~Math",
530 "~Matrix",
531 "~PathOpsCubic",
benjaminwagnerb5188622016-06-29 10:26:44 -0700532 "~PathOpsFailOp",
caryclark523e76d2016-07-19 12:27:32 -0700533 "~PathOpsOpCubicsThreaded",
benjaminwagner83906ae2016-05-01 15:02:25 -0700534 "~PathOpsOpLoopsThreaded",
535 "~PathOpsSimplify",
536 "~PathOpsTightBoundsQuads",
537 "~Point",
benjaminwagner1d352312016-07-25 06:32:13 -0700538 "~sk_linear_to_srgb",
benjaminwagner56f6d062016-01-13 10:45:19 -0800539 ]
benjaminwagner83906ae2016-05-01 15:02:25 -0700540 return [
541 "--src %s" % " ".join(source),
542 "--config %s" % " ".join(config),
543 "--verbose",
544 "--match %s" % " ".join(match),
545 "--resourcePath %s/resources" % base_dir,
546 "--images %s/resources" % base_dir,
547 ]
benjaminwagner56f6d062016-01-13 10:45:19 -0800548
549################################################################################
550## COPTS
551################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800552
benjaminwagner86ea33e2015-10-26 10:46:25 -0700553COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700554 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700555 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700556]
557
benjaminwagner56f6d062016-01-13 10:45:19 -0800558COPTS_ANDROID = ["-mfpu=neon"]
559
560COPTS_IOS = []
561
562COPTS_ALL = []
563
564################################################################################
565## DEFINES
566################################################################################
567
568DEFINES_UNIX = [
scroggo7732c0c2016-06-22 07:25:16 -0700569 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800570 "SK_BUILD_FOR_UNIX",
571 "SK_SAMPLES_FOR_X",
halcanary650e20d2016-08-25 09:07:02 -0700572 "SK_PDF_USE_SFNTLY",
benjaminwagner186e0b92016-02-11 16:00:24 -0800573 "SK_CODEC_DECODES_RAW",
msarettad3a5c62016-05-06 07:21:26 -0700574 "SK_HAS_GIF_LIBRARY",
575 "SK_HAS_JPEG_LIBRARY",
scroggoe6939c12016-06-21 14:13:40 -0700576 "SK_HAS_PNG_LIBRARY",
scroggo7732c0c2016-06-22 07:25:16 -0700577 "SK_HAS_WEBP_LIBRARY",
benjaminwagner56f6d062016-01-13 10:45:19 -0800578]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700579
580DEFINES_ANDROID = [
581 "SK_BUILD_FOR_ANDROID",
benjaminwagner186e0b92016-02-11 16:00:24 -0800582 "SK_CODEC_DECODES_RAW",
msarettad3a5c62016-05-06 07:21:26 -0700583 "SK_HAS_GIF_LIBRARY",
584 "SK_HAS_JPEG_LIBRARY",
scroggoe6939c12016-06-21 14:13:40 -0700585 "SK_HAS_PNG_LIBRARY",
scroggo7732c0c2016-06-22 07:25:16 -0700586 "SK_HAS_WEBP_LIBRARY",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700587]
588
iroth8b99ef42015-11-02 11:11:21 -0800589DEFINES_IOS = [
590 "SK_BUILD_FOR_IOS",
sdefresnee3fa8112016-06-01 07:08:56 -0700591 "SK_BUILD_NO_OPTS",
iroth8b99ef42015-11-02 11:11:21 -0800592 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800593 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800594]
595
benjaminwagner86ea33e2015-10-26 10:46:25 -0700596DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700597 # Chrome DEFINES.
598 "SK_USE_FLOATBITS",
599 "SK_USE_FREETYPE_EMBOLDEN",
600 # Turn on a few Google3-specific build fixes.
601 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700602 # Staging flags for API changes
benjaminwagnerbddb3722016-07-22 06:19:21 -0700603 "SK_SUPPORT_LEGACY_ACCESSBITMAP",
benjaminwagnerb3a3b582016-09-27 12:28:20 -0700604 "SK_SUPPORT_LEGACY_ARITHMETICMODE",
reedd053ce92016-03-22 10:17:23 -0700605 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
606 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
benjaminwagnerbddb3722016-07-22 06:19:21 -0700607 "SK_SUPPORT_LEGACY_IMAGEFACTORY",
benjaminwagner31dcc2a2016-04-01 06:54:34 -0700608 "SK_SUPPORT_LEGACY_IMAGEFILTER_PTR",
benjaminwagnerbddb3722016-07-22 06:19:21 -0700609 "SK_SUPPORT_LEGACY_MASKFILTER_PTR",
benjaminwagner31dcc2a2016-04-01 06:54:34 -0700610 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
robertphillips0652baa2016-08-08 09:17:20 -0700611 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
benjaminwagner31dcc2a2016-04-01 06:54:34 -0700612 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
fmalita41c40962016-03-24 11:05:28 -0700613 "SK_SUPPORT_LEGACY_PICTURE_PTR",
bungeman13b9c952016-05-12 10:09:30 -0700614 "SK_SUPPORT_LEGACY_TYPEFACE_PTR",
benjaminwagnerbddb3722016-07-22 06:19:21 -0700615 "SK_SUPPORT_LEGACY_XFERMODE_PTR",
reeddfd32b72016-08-11 05:04:51 -0700616 "SK_SUPPORT_LEGACY_PICTUREINSTALLPIXELREF",
reed42943c82016-09-12 12:01:44 -0700617 "SK_SUPPORT_LEGACY_STREAM_DATA",
fmalita37283c22016-09-13 10:00:23 -0700618 "SK_SUPPORT_LEGACY_TEXTBLOB_BUILDER",
reed73603f32016-09-20 08:42:38 -0700619 "SK_SUPPORT_LEGACY_CLIP_REGIONOPS",
Mike Reed627778d2016-09-28 17:13:38 -0400620 "SK_SUPPORT_LEGACY_SHADER_ISABITMAP",
benjaminwagner787ca872015-08-17 12:58:10 -0700621]
622
benjaminwagner56f6d062016-01-13 10:45:19 -0800623################################################################################
624## LINKOPTS
625################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700626
benjaminwagner56f6d062016-01-13 10:45:19 -0800627LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700628
benjaminwagner56f6d062016-01-13 10:45:19 -0800629LINKOPTS_ANDROID = [
630 "-lEGL",
631]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700632
benjaminwagner56f6d062016-01-13 10:45:19 -0800633LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700634
benjaminwagner56f6d062016-01-13 10:45:19 -0800635LINKOPTS_ALL = [
636 "-ldl",
637]