blob: ad5d231d326bfc3830713d4a964897e9e0a936d0 [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",
mtkleine1fc4522016-02-09 12:32:52 -0800411 "tools/random_parse_path.cpp",
412 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700413 "tools/sk_tool_utils.cpp",
414 "tools/sk_tool_utils.h",
415 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700416 "tools/timer/*.cpp",
417 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700418 ],
419 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700420 "dm/DMSrcSinkAndroid.cpp", # Android-only.
421 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
422 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700423 "tests/skia_test.cpp", # Old main.
424 "tests/SkpSkGrTest.cpp", # Alternate main.
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
benjaminwagner56f6d062016-01-13 10:45:19 -0800486def DM_ARGS(base_dir):
487 return [
488 "--nogpu",
489 "--verbose",
490 # TODO(mtklein): maybe investigate why these fail?
benjaminwagnerf6bfccd2016-02-25 10:28:11 -0800491 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText",
benjaminwagner56f6d062016-01-13 10:45:19 -0800492 "--resourcePath %s/resources" % base_dir,
493 "--images %s/resources" % base_dir,
494 ]
495
496################################################################################
497## COPTS
498################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800499
benjaminwagner86ea33e2015-10-26 10:46:25 -0700500COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700501 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700502 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700503]
504
benjaminwagner56f6d062016-01-13 10:45:19 -0800505COPTS_ANDROID = ["-mfpu=neon"]
506
507COPTS_IOS = []
508
509COPTS_ALL = []
510
511################################################################################
512## DEFINES
513################################################################################
514
515DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800516 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800517 "SK_BUILD_FOR_UNIX",
518 "SK_SAMPLES_FOR_X",
519 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800520 "SK_CODEC_DECODES_GIF",
521 "SK_CODEC_DECODES_JPEG",
522 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800523 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800524 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800525]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700526
527DEFINES_ANDROID = [
528 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800529 "SK_CODEC_DECODES_GIF",
530 "SK_CODEC_DECODES_JPEG",
531 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800532 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800533 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700534]
535
iroth8b99ef42015-11-02 11:11:21 -0800536DEFINES_IOS = [
537 "SK_BUILD_FOR_IOS",
538 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800539 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800540]
541
benjaminwagner86ea33e2015-10-26 10:46:25 -0700542DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700543 # Chrome DEFINES.
544 "SK_USE_FLOATBITS",
545 "SK_USE_FREETYPE_EMBOLDEN",
546 # Turn on a few Google3-specific build fixes.
547 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700548 # Staging flags for API changes
549 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
550 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
benjaminwagner31dcc2a2016-04-01 06:54:34 -0700551 "SK_SUPPORT_LEGACY_IMAGEFILTER_PTR",
552 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
553 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
554 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
fmalita41c40962016-03-24 11:05:28 -0700555 "SK_SUPPORT_LEGACY_PICTURE_PTR",
reedefdfd512016-04-04 10:02:58 -0700556 "SK_SUPPORT_LEGACY_MASKFILTER_PTR",
reedcfb6bdf2016-03-29 11:32:50 -0700557 "SK_SUPPORT_LEGACY_XFERMODE_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700558]
559
benjaminwagner56f6d062016-01-13 10:45:19 -0800560################################################################################
561## LINKOPTS
562################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700563
benjaminwagner56f6d062016-01-13 10:45:19 -0800564LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700565
benjaminwagner56f6d062016-01-13 10:45:19 -0800566LINKOPTS_ANDROID = [
567 "-lEGL",
568]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700569
benjaminwagner56f6d062016-01-13 10:45:19 -0800570LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700571
benjaminwagner56f6d062016-01-13 10:45:19 -0800572LINKOPTS_ALL = [
573 "-ldl",
574]