blob: 4cd21454d59e03445281c198720f6c5f16b68552 [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.
117 "src/svg/parser/*", # Missing SkSVG.h.
118
benjaminwagner39e7aa42015-11-18 13:26:10 -0800119 # Conflicting dependencies among Lua versions. See cl/107087297.
120 "src/utils/SkLua*",
121
benjaminwagner6f6bef82015-10-15 08:09:44 -0700122 # Not used.
123 "src/animator/**/*",
124 "src/views/**/*",
125 "src/xml/SkBML_Verbs.h",
126 "src/xml/SkBML_XMLParser.cpp",
127 "src/xml/SkXMLPullParser.cpp",
egdaniel32119f12016-02-22 10:07:54 -0800128
129 # Currently exclude all vulkan specific files
130 "src/gpu/vk/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700131 ],
132)
133
134# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800135BASE_SRCS_UNIX = struct(
136 include = [
irothd2ccc772016-01-25 11:24:57 -0800137 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800138 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800139 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth5f0de062016-02-17 12:47:27 -0800140 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800141 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700142 "src/opts/**/*.cpp",
143 "src/opts/**/*.h",
144 "src/ports/**/*.cpp",
145 "src/ports/**/*.h",
146 ],
147 exclude = [
148 "src/opts/*arm*",
149 "src/opts/*mips*",
150 "src/opts/*NEON*",
151 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700152 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700153 "src/opts/*SSSE3*",
154 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700155 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700156 "src/opts/*SSE4*",
157 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800158 # Included in :opts_avx or :opts_avx2
159 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700160 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700161 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700162 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800163 "src/ports/*CG*",
msarettfc0b6d12016-03-17 13:50:17 -0700164 "src/ports/*WIC*",
mtklein3f193a92016-03-10 08:52:05 -0800165 "src/ports/*android*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700166 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700167 "src/ports/*mac*",
168 "src/ports/*mozalloc*",
169 "src/ports/*nacl*",
170 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800171 "src/ports/SkFontConfigInterface_direct_factory.cpp",
172 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700173 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700174 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700175 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800176 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800177 "src/ports/SkFontMgr_fontconfig_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700178 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700179 "src/ports/SkImageGenerator_none.cpp",
180 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700181 ],
182)
183
benjaminwagner86ea33e2015-10-26 10:46:25 -0700184# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800185BASE_SRCS_ANDROID = struct(
186 include = [
irothd2ccc772016-01-25 11:24:57 -0800187 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800188 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800189 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800190 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700191 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700192 "src/opts/**/*.cpp",
193 "src/opts/**/*.h",
194 "src/ports/**/*.cpp",
195 "src/ports/**/*.h",
196 ],
197 exclude = [
198 "src/opts/*mips*",
199 "src/opts/*SSE2*",
200 "src/opts/*SSSE3*",
201 "src/opts/*ssse3*",
202 "src/opts/*SSE4*",
203 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800204 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700205 "src/opts/*x86*",
206 "src/opts/SkBitmapProcState_opts_none.cpp",
207 "src/opts/SkBlitMask_opts_none.cpp",
208 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800209 "src/ports/*CG*",
mtklein3f193a92016-03-10 08:52:05 -0800210 "src/ports/*FontConfig*",
msarettfc0b6d12016-03-17 13:50:17 -0700211 "src/ports/*WIC*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700212 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700213 "src/ports/*fontconfig*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700214 "src/ports/*mac*",
215 "src/ports/*mozalloc*",
216 "src/ports/*nacl*",
217 "src/ports/*win*",
218 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800219 "src/ports/SkFontConfigInterface_direct_factory.cpp",
220 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700221 "src/ports/SkFontMgr_custom_directory_factory.cpp",
222 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700223 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700224 "src/ports/SkFontMgr_empty_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700225 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700226 "src/ports/SkImageGenerator_none.cpp",
227 "src/ports/SkTLS_none.cpp",
228 ],
229)
230
iroth8b99ef42015-11-02 11:11:21 -0800231# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800232BASE_SRCS_IOS = struct(
233 include = [
msarett2775cf52016-02-17 14:14:25 -0800234 "src/android/*",
235 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800236 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
237 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800238 "src/opts/**/*.cpp",
239 "src/opts/**/*.h",
240 "src/ports/**/*.cpp",
241 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800242 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800243 ],
244 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800245 "src/codec/*Gif*.cpp",
246 "src/codec/*Ico*.cpp",
247 "src/codec/*Jpeg*.cpp",
248 "src/codec/*Webp*.cpp",
249 "src/codec/*Png*",
250 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800251 "src/opts/*mips*",
252 "src/opts/*NEON*",
253 "src/opts/*neon*",
254 "src/opts/*SSE2*",
255 "src/opts/*SSSE3*",
256 "src/opts/*ssse3*",
257 "src/opts/*SSE4*",
258 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800259 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800260 "src/opts/*x86*",
261 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800262 "src/opts/SkBlitMask_opts_arm*.cpp",
263 "src/opts/SkBlitRow_opts_arm*.cpp",
mtklein3f193a92016-03-10 08:52:05 -0800264 "src/ports/*CG*",
265 "src/ports/*FontConfig*",
266 "src/ports/*FreeType*",
msarettfc0b6d12016-03-17 13:50:17 -0700267 "src/ports/*WIC*",
iroth8b99ef42015-11-02 11:11:21 -0800268 "src/ports/*android*",
269 "src/ports/*chromium*",
270 "src/ports/*fontconfig*",
iroth8b99ef42015-11-02 11:11:21 -0800271 "src/ports/*mozalloc*",
272 "src/ports/*nacl*",
273 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800274 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800275 "src/ports/SkFontConfigInterface_direct_factory.cpp",
276 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800277 "src/ports/SkFontMgr_custom_directory_factory.cpp",
278 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700279 "src/ports/SkFontMgr_custom_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800280 "src/ports/SkFontMgr_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800281 "src/ports/SkImageGenerator_none.cpp",
282 "src/ports/SkTLS_none.cpp",
283 ],
284)
285
benjaminwagner56f6d062016-01-13 10:45:19 -0800286################################################################################
287## SSSE3/SSE4/AVX/AVX2 SRCS
288################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700289
benjaminwagner56f6d062016-01-13 10:45:19 -0800290SSSE3_SRCS = struct(
291 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700292 "src/opts/*SSSE3*.cpp",
293 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800294 ],
295)
mtkleind55d13a2015-08-18 08:51:49 -0700296
benjaminwagner56f6d062016-01-13 10:45:19 -0800297SSE4_SRCS = struct(
298 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700299 "src/opts/*SSE4*.cpp",
300 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800301 ],
302)
benjaminwagner787ca872015-08-17 12:58:10 -0700303
benjaminwagner56f6d062016-01-13 10:45:19 -0800304AVX_SRCS = struct(
305 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800306 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800307 ],
308)
mtkleinf6d8d282015-12-17 10:18:04 -0800309
benjaminwagner56f6d062016-01-13 10:45:19 -0800310AVX2_SRCS = struct(
311 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800312 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800313 ],
314)
mtkleinf6d8d282015-12-17 10:18:04 -0800315
benjaminwagner56f6d062016-01-13 10:45:19 -0800316################################################################################
317## BASE_HDRS
318################################################################################
319
320BASE_HDRS = struct(
321 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700322 "include/**/*.h",
323 ],
iroth849b1752016-04-11 13:45:51 -0700324 exclude = PRIVATE_HDRS_LIST + [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700325 # Not used.
326 "include/animator/**/*",
327 "include/views/**/*",
328 "include/xml/SkBML_WXMLParser.h",
329 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800330 ],
331)
benjaminwagner787ca872015-08-17 12:58:10 -0700332
benjaminwagner56f6d062016-01-13 10:45:19 -0800333################################################################################
334## BASE_DEPS
335################################################################################
336
337BASE_DEPS_ALL = []
338
benjaminwagner39e7aa42015-11-18 13:26:10 -0800339BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800340 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800341 ":opts_sse4",
342 ":opts_avx",
343 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800344]
345
346BASE_DEPS_ANDROID = []
347
348BASE_DEPS_IOS = []
349
benjaminwagner56f6d062016-01-13 10:45:19 -0800350################################################################################
351## INCLUDES
352################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800353
benjaminwagner787ca872015-08-17 12:58:10 -0700354# Includes needed by Skia implementation. Not public includes.
355INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800356 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700357 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800358 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700359 "include/codec",
360 "include/config",
361 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700362 "include/effects",
363 "include/gpu",
364 "include/images",
365 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700366 "include/pipe",
367 "include/ports",
368 "include/private",
369 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800370 "include/utils/mac",
371 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700372 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700373 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800374 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700375 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700376 "src/gpu",
377 "src/image",
378 "src/lazy",
379 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800380 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700381 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700382 "src/sfnt",
383 "src/utils",
384 "third_party/etc1",
385 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800386]
benjaminwagner787ca872015-08-17 12:58:10 -0700387
benjaminwagner56f6d062016-01-13 10:45:19 -0800388################################################################################
389## DM_SRCS
390################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700391
benjaminwagner56f6d062016-01-13 10:45:19 -0800392DM_SRCS_ALL = struct(
393 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700394 "dm/*.cpp",
395 "dm/*.h",
396 "gm/*.c",
397 "gm/*.cpp",
398 "gm/*.h",
399 "tests/*.cpp",
400 "tests/*.h",
401 "tools/CrashHandler.cpp",
402 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700403 "tools/ProcStats.cpp",
404 "tools/ProcStats.h",
405 "tools/Resources.cpp",
406 "tools/Resources.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700407 "tools/flags/*.cpp",
408 "tools/flags/*.h",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700409 "tools/gpu/**/*.cpp",
410 "tools/gpu/**/*.h",
brianosman6d3119c2016-04-19 19:41:54 -0700411 "tools/picture_utils.cpp",
mtkleine1fc4522016-02-09 12:32:52 -0800412 "tools/random_parse_path.cpp",
413 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700414 "tools/sk_tool_utils.cpp",
415 "tools/sk_tool_utils.h",
416 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700417 "tools/timer/*.cpp",
418 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700419 ],
420 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700421 "dm/DMSrcSinkAndroid.cpp", # Android-only.
422 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
423 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700424 "tests/skia_test.cpp", # Old main.
425 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner38d68bc2016-04-01 05:00:51 -0700426 "tools/gpu/gl/angle/*",
427 "tools/gpu/gl/command_buffer/*",
428 "tools/gpu/gl/egl/*",
429 "tools/gpu/gl/glx/*",
430 "tools/gpu/gl/iOS/*",
431 "tools/gpu/gl/mac/*",
432 "tools/gpu/gl/mesa/*",
433 "tools/gpu/gl/win/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700434 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700435 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700436 ],
437)
438
benjaminwagner38d68bc2016-04-01 05:00:51 -0700439DM_SRCS_UNIX = struct(
440 include = [
441 "tools/gpu/gl/CreatePlatformGLContext_none.cpp",
442 ],
443)
benjaminwagner86ea33e2015-10-26 10:46:25 -0700444
benjaminwagner56f6d062016-01-13 10:45:19 -0800445DM_SRCS_ANDROID = struct(
446 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700447 # Depends on Android HWUI library that is not available in google3.
448 #"dm/DMSrcSinkAndroid.cpp",
449 "tests/FontMgrAndroidParserTest.cpp",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700450 # TODO(benjaminwagner): Figure out how to compile with EGL.
451 "tools/gpu/gl/CreatePlatformGLContext_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700452 ],
453)
454
benjaminwagner38d68bc2016-04-01 05:00:51 -0700455DM_SRCS_IOS = struct(
456 include = [
457 "tools/gpu/iOS/CreatePlatformGLContext_iOS.cpp",
458 ],
459)
benjaminwagner56f6d062016-01-13 10:45:19 -0800460
461################################################################################
462## DM_INCLUDES
463################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700464
benjaminwagner6f6bef82015-10-15 08:09:44 -0700465DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800466 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700467 "gm",
468 "src/codec",
469 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800470 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700471 "src/fonts",
472 "src/pathops",
473 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700474 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800475 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700476 "tests",
477 "tools",
478 "tools/flags",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700479 "tools/gpu",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700480 "tools/timer",
481]
482
benjaminwagner56f6d062016-01-13 10:45:19 -0800483################################################################################
484## DM_ARGS
485################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700486
benjaminwagner83906ae2016-05-01 15:02:25 -0700487def DM_ARGS(base_dir, asan):
488 source = ["tests", "gm", "image"]
489 # TODO(benjaminwagner): f16 and serialize-8888 fail.
490 config = ["565", "8888", "pdf", "srgb", "tiles_rt", "pic"]
491 # TODO(mtklein): maybe investigate why these fail?
492 match = [
493 "~Canvas",
494 "~Codec",
495 "~Codec_Dimensions",
496 "~Codec_stripes",
497 "~FontMgr",
498 "~PaintBreakText",
499 "~RecordDraw_TextBounds",
500 "~Scalar",
501 "~skps",
502 "~Stream",
503 ]
504 if asan:
505 # Running all sources and configs under ASAN causes the test to exceed
506 # "large" size and time out.
507 source = ["tests", "gm"]
508 config = ["8888"]
509 match += [
510 "~clippedcubic2",
511 "~conicpaths",
512 "~gradients_2pt_conical",
513 "~Math",
514 "~Matrix",
515 "~PathOpsCubic",
516 "~PathOpsOpLoopsThreaded",
517 "~PathOpsSimplify",
518 "~PathOpsTightBoundsQuads",
519 "~Point",
benjaminwagner56f6d062016-01-13 10:45:19 -0800520 ]
benjaminwagner83906ae2016-05-01 15:02:25 -0700521 return [
522 "--src %s" % " ".join(source),
523 "--config %s" % " ".join(config),
524 "--verbose",
525 "--match %s" % " ".join(match),
526 "--resourcePath %s/resources" % base_dir,
527 "--images %s/resources" % base_dir,
528 ]
benjaminwagner56f6d062016-01-13 10:45:19 -0800529
530################################################################################
531## COPTS
532################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800533
benjaminwagner86ea33e2015-10-26 10:46:25 -0700534COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700535 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700536 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700537]
538
benjaminwagner56f6d062016-01-13 10:45:19 -0800539COPTS_ANDROID = ["-mfpu=neon"]
540
541COPTS_IOS = []
542
543COPTS_ALL = []
544
545################################################################################
546## DEFINES
547################################################################################
548
549DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800550 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800551 "SK_BUILD_FOR_UNIX",
552 "SK_SAMPLES_FOR_X",
553 "SK_SFNTLY_SUBSETTER",
benjaminwagner186e0b92016-02-11 16:00:24 -0800554 "SK_CODEC_DECODES_RAW",
msarettad3a5c62016-05-06 07:21:26 -0700555 "SK_HAS_GIF_LIBRARY",
556 "SK_HAS_JPEG_LIBRARY",
557 "SK_HAS_PNG_LIBRARY",
558 "SK_HAS_WEBP_LIBRARY",
benjaminwagner56f6d062016-01-13 10:45:19 -0800559]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700560
561DEFINES_ANDROID = [
562 "SK_BUILD_FOR_ANDROID",
benjaminwagner186e0b92016-02-11 16:00:24 -0800563 "SK_CODEC_DECODES_RAW",
msarettad3a5c62016-05-06 07:21:26 -0700564 "SK_HAS_GIF_LIBRARY",
565 "SK_HAS_JPEG_LIBRARY",
566 "SK_HAS_PNG_LIBRARY",
567 "SK_HAS_WEBP_LIBRARY",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700568]
569
iroth8b99ef42015-11-02 11:11:21 -0800570DEFINES_IOS = [
571 "SK_BUILD_FOR_IOS",
572 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800573 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800574]
575
benjaminwagner86ea33e2015-10-26 10:46:25 -0700576DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700577 # Chrome DEFINES.
578 "SK_USE_FLOATBITS",
579 "SK_USE_FREETYPE_EMBOLDEN",
580 # Turn on a few Google3-specific build fixes.
581 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700582 # Staging flags for API changes
583 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
584 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
benjaminwagner31dcc2a2016-04-01 06:54:34 -0700585 "SK_SUPPORT_LEGACY_IMAGEFILTER_PTR",
586 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
587 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
588 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
fmalita41c40962016-03-24 11:05:28 -0700589 "SK_SUPPORT_LEGACY_PICTURE_PTR",
reedefdfd512016-04-04 10:02:58 -0700590 "SK_SUPPORT_LEGACY_MASKFILTER_PTR",
reed2a041042016-04-15 10:56:51 -0700591 "SK_SUPPORT_LEGACY_IMAGEFACTORY",
reedcfb6bdf2016-03-29 11:32:50 -0700592 "SK_SUPPORT_LEGACY_XFERMODE_PTR",
bungeman13b9c952016-05-12 10:09:30 -0700593 "SK_SUPPORT_LEGACY_TYPEFACE_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700594]
595
benjaminwagner56f6d062016-01-13 10:45:19 -0800596################################################################################
597## LINKOPTS
598################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700599
benjaminwagner56f6d062016-01-13 10:45:19 -0800600LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700601
benjaminwagner56f6d062016-01-13 10:45:19 -0800602LINKOPTS_ANDROID = [
603 "-lEGL",
604]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700605
benjaminwagner56f6d062016-01-13 10:45:19 -0800606LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700607
benjaminwagner56f6d062016-01-13 10:45:19 -0800608LINKOPTS_ALL = [
609 "-ldl",
610]