blob: ba10d3127ae6242b4d7bbc78822794eccdceb19d [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################################################################################
55## BASE_SRCS
56################################################################################
benjaminwagner787ca872015-08-17 12:58:10 -070057
benjaminwagner39e7aa42015-11-18 13:26:10 -080058# All platform-independent SRCS.
benjaminwagner56f6d062016-01-13 10:45:19 -080059BASE_SRCS_ALL = struct(
60 include = [
mtkleind55d13a2015-08-18 08:51:49 -070061 "include/private/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -070062 "src/**/*.h",
63 "src/**/*.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -070064
mtkleind55d13a2015-08-18 08:51:49 -070065 # Third Party
benjaminwagner787ca872015-08-17 12:58:10 -070066 "third_party/etc1/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070067 "third_party/etc1/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070068 "third_party/ktx/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070069 "third_party/ktx/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070070 ],
71 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -070072 # Exclude platform-dependent files.
irothd2ccc772016-01-25 11:24:57 -080073 "src/android/*",
iroth76a12252016-01-07 07:11:39 -080074 "src/codec/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070075 "src/device/xps/*", # Windows-only. Move to ports?
76 "src/doc/*_XPS.cpp", # Windows-only. Move to ports?
benjaminwagner2211a7b2015-12-01 11:12:05 -080077 "src/fonts/SkFontMgr_fontconfig.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070078 "src/gpu/gl/android/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -070079 "src/gpu/gl/egl/*",
80 "src/gpu/gl/glx/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070081 "src/gpu/gl/iOS/*",
82 "src/gpu/gl/mac/*",
83 "src/gpu/gl/win/*",
iroth76a12252016-01-07 07:11:39 -080084 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070085 "src/opts/**/*",
86 "src/ports/**/*",
87 "src/utils/android/**/*",
88 "src/utils/mac/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070089 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
90 "src/utils/win/**/*",
91 "src/views/sdl/*",
92 "src/views/win/*",
93 "src/views/unix/*",
94
95 # Exclude multiple definitions.
96 # TODO(mtklein): Move to opts?
benjaminwagnerca26a182016-03-14 15:21:12 -070097 "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp.
benjaminwagner86ea33e2015-10-26 10:46:25 -070098 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
99 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
iroth5f0de062016-02-17 12:47:27 -0800100 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700101
102 # Exclude files that don't compile with the current DEFINES.
103 "src/gpu/gl/angle/*", # Requires SK_ANGLE define.
104 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE'
105 "src/gpu/gl/mesa/*", # Requires SK_MESA define.
106 "src/svg/parser/*", # Missing SkSVG.h.
107
benjaminwagner39e7aa42015-11-18 13:26:10 -0800108 # Conflicting dependencies among Lua versions. See cl/107087297.
109 "src/utils/SkLua*",
110
benjaminwagner6f6bef82015-10-15 08:09:44 -0700111 # Not used.
112 "src/animator/**/*",
113 "src/views/**/*",
114 "src/xml/SkBML_Verbs.h",
115 "src/xml/SkBML_XMLParser.cpp",
116 "src/xml/SkXMLPullParser.cpp",
egdaniel32119f12016-02-22 10:07:54 -0800117
118 # Currently exclude all vulkan specific files
119 "src/gpu/vk/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700120 ],
121)
122
123# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800124BASE_SRCS_UNIX = struct(
125 include = [
irothd2ccc772016-01-25 11:24:57 -0800126 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800127 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800128 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth5f0de062016-02-17 12:47:27 -0800129 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800130 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700131 "src/opts/**/*.cpp",
132 "src/opts/**/*.h",
133 "src/ports/**/*.cpp",
134 "src/ports/**/*.h",
135 ],
136 exclude = [
137 "src/opts/*arm*",
138 "src/opts/*mips*",
139 "src/opts/*NEON*",
140 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700141 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700142 "src/opts/*SSSE3*",
143 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700144 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700145 "src/opts/*SSE4*",
146 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800147 # Included in :opts_avx or :opts_avx2
148 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700149 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700150 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700151 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800152 "src/ports/*CG*",
msarettfc0b6d12016-03-17 13:50:17 -0700153 "src/ports/*WIC*",
mtklein3f193a92016-03-10 08:52:05 -0800154 "src/ports/*android*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700155 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700156 "src/ports/*mac*",
157 "src/ports/*mozalloc*",
158 "src/ports/*nacl*",
159 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800160 "src/ports/SkFontConfigInterface_direct_factory.cpp",
161 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700162 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700163 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700164 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800165 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800166 "src/ports/SkFontMgr_fontconfig_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700167 "src/ports/SkImageDecoder_empty.cpp",
msarettc1d03122016-03-25 08:58:55 -0700168 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700169 "src/ports/SkImageGenerator_none.cpp",
170 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700171 ],
172)
173
benjaminwagner86ea33e2015-10-26 10:46:25 -0700174# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800175BASE_SRCS_ANDROID = struct(
176 include = [
irothd2ccc772016-01-25 11:24:57 -0800177 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800178 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800179 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800180 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700181 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700182 "src/opts/**/*.cpp",
183 "src/opts/**/*.h",
184 "src/ports/**/*.cpp",
185 "src/ports/**/*.h",
186 ],
187 exclude = [
188 "src/opts/*mips*",
189 "src/opts/*SSE2*",
190 "src/opts/*SSSE3*",
191 "src/opts/*ssse3*",
192 "src/opts/*SSE4*",
193 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800194 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700195 "src/opts/*x86*",
196 "src/opts/SkBitmapProcState_opts_none.cpp",
197 "src/opts/SkBlitMask_opts_none.cpp",
198 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800199 "src/ports/*CG*",
mtklein3f193a92016-03-10 08:52:05 -0800200 "src/ports/*FontConfig*",
msarettfc0b6d12016-03-17 13:50:17 -0700201 "src/ports/*WIC*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700202 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700203 "src/ports/*fontconfig*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700204 "src/ports/*mac*",
205 "src/ports/*mozalloc*",
206 "src/ports/*nacl*",
207 "src/ports/*win*",
208 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800209 "src/ports/SkFontConfigInterface_direct_factory.cpp",
210 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700211 "src/ports/SkFontMgr_custom_directory_factory.cpp",
212 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700213 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700214 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700215 "src/ports/SkImageDecoder_empty.cpp",
msarettc1d03122016-03-25 08:58:55 -0700216 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700217 "src/ports/SkImageGenerator_none.cpp",
218 "src/ports/SkTLS_none.cpp",
219 ],
220)
221
iroth8b99ef42015-11-02 11:11:21 -0800222# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800223BASE_SRCS_IOS = struct(
224 include = [
msarett2775cf52016-02-17 14:14:25 -0800225 "src/android/*",
226 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800227 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
228 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800229 "src/opts/**/*.cpp",
230 "src/opts/**/*.h",
231 "src/ports/**/*.cpp",
232 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800233 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800234 ],
235 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800236 "src/codec/*Gif*.cpp",
237 "src/codec/*Ico*.cpp",
238 "src/codec/*Jpeg*.cpp",
239 "src/codec/*Webp*.cpp",
240 "src/codec/*Png*",
241 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800242 "src/opts/*mips*",
243 "src/opts/*NEON*",
244 "src/opts/*neon*",
245 "src/opts/*SSE2*",
246 "src/opts/*SSSE3*",
247 "src/opts/*ssse3*",
248 "src/opts/*SSE4*",
249 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800250 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800251 "src/opts/*x86*",
252 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800253 "src/opts/SkBlitMask_opts_arm*.cpp",
254 "src/opts/SkBlitRow_opts_arm*.cpp",
mtklein3f193a92016-03-10 08:52:05 -0800255 "src/ports/*CG*",
256 "src/ports/*FontConfig*",
257 "src/ports/*FreeType*",
msarettfc0b6d12016-03-17 13:50:17 -0700258 "src/ports/*WIC*",
iroth8b99ef42015-11-02 11:11:21 -0800259 "src/ports/*android*",
260 "src/ports/*chromium*",
261 "src/ports/*fontconfig*",
iroth8b99ef42015-11-02 11:11:21 -0800262 "src/ports/*mozalloc*",
263 "src/ports/*nacl*",
264 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800265 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800266 "src/ports/SkFontConfigInterface_direct_factory.cpp",
267 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800268 "src/ports/SkFontMgr_custom_directory_factory.cpp",
269 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700270 "src/ports/SkFontMgr_custom_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800271 "src/ports/SkFontMgr_empty_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700272 "src/ports/SkImageDecoder_empty.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800273 "src/ports/SkImageGenerator_none.cpp",
274 "src/ports/SkTLS_none.cpp",
275 ],
276)
277
benjaminwagner56f6d062016-01-13 10:45:19 -0800278################################################################################
279## SSSE3/SSE4/AVX/AVX2 SRCS
280################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700281
benjaminwagner56f6d062016-01-13 10:45:19 -0800282SSSE3_SRCS = struct(
283 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700284 "src/opts/*SSSE3*.cpp",
285 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800286 ],
287)
mtkleind55d13a2015-08-18 08:51:49 -0700288
benjaminwagner56f6d062016-01-13 10:45:19 -0800289SSE4_SRCS = struct(
290 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700291 "src/opts/*SSE4*.cpp",
292 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800293 ],
294)
benjaminwagner787ca872015-08-17 12:58:10 -0700295
benjaminwagner56f6d062016-01-13 10:45:19 -0800296AVX_SRCS = struct(
297 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800298 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800299 ],
300)
mtkleinf6d8d282015-12-17 10:18:04 -0800301
benjaminwagner56f6d062016-01-13 10:45:19 -0800302AVX2_SRCS = struct(
303 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800304 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800305 ],
306)
mtkleinf6d8d282015-12-17 10:18:04 -0800307
benjaminwagner56f6d062016-01-13 10:45:19 -0800308################################################################################
309## BASE_HDRS
310################################################################################
311
312BASE_HDRS = struct(
313 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700314 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800315 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700316 ],
mtkleind55d13a2015-08-18 08:51:49 -0700317 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700318 "include/private/**/*",
319
320 # Not used.
321 "include/animator/**/*",
322 "include/views/**/*",
323 "include/xml/SkBML_WXMLParser.h",
324 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800325 ],
326)
benjaminwagner787ca872015-08-17 12:58:10 -0700327
benjaminwagner56f6d062016-01-13 10:45:19 -0800328################################################################################
329## BASE_DEPS
330################################################################################
331
332BASE_DEPS_ALL = []
333
benjaminwagner39e7aa42015-11-18 13:26:10 -0800334BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800335 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800336 ":opts_sse4",
337 ":opts_avx",
338 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800339]
340
341BASE_DEPS_ANDROID = []
342
343BASE_DEPS_IOS = []
344
benjaminwagner56f6d062016-01-13 10:45:19 -0800345################################################################################
346## INCLUDES
347################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800348
benjaminwagner787ca872015-08-17 12:58:10 -0700349# Includes needed by Skia implementation. Not public includes.
350INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800351 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700352 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800353 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700354 "include/codec",
355 "include/config",
356 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700357 "include/effects",
358 "include/gpu",
359 "include/images",
360 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700361 "include/pipe",
362 "include/ports",
363 "include/private",
364 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800365 "include/utils/mac",
366 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700367 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700368 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800369 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700370 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700371 "src/gpu",
372 "src/image",
373 "src/lazy",
374 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800375 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700376 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700377 "src/sfnt",
378 "src/utils",
379 "third_party/etc1",
380 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800381]
benjaminwagner787ca872015-08-17 12:58:10 -0700382
benjaminwagner56f6d062016-01-13 10:45:19 -0800383################################################################################
384## DM_SRCS
385################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700386
benjaminwagner56f6d062016-01-13 10:45:19 -0800387DM_SRCS_ALL = struct(
388 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700389 "dm/*.cpp",
390 "dm/*.h",
391 "gm/*.c",
392 "gm/*.cpp",
393 "gm/*.h",
394 "tests/*.cpp",
395 "tests/*.h",
396 "tools/CrashHandler.cpp",
397 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700398 "tools/ProcStats.cpp",
399 "tools/ProcStats.h",
400 "tools/Resources.cpp",
401 "tools/Resources.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700402 "tools/flags/*.cpp",
403 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800404 "tools/random_parse_path.cpp",
405 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700406 "tools/sk_tool_utils.cpp",
407 "tools/sk_tool_utils.h",
408 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700409 "tools/timer/*.cpp",
410 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700411 ],
412 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700413 "dm/DMSrcSinkAndroid.cpp", # Android-only.
414 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
415 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700416 "tests/skia_test.cpp", # Old main.
417 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700418 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700419 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700420 ],
421)
422
benjaminwagner56f6d062016-01-13 10:45:19 -0800423DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700424
benjaminwagner56f6d062016-01-13 10:45:19 -0800425DM_SRCS_ANDROID = struct(
426 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700427 # Depends on Android HWUI library that is not available in google3.
428 #"dm/DMSrcSinkAndroid.cpp",
429 "tests/FontMgrAndroidParserTest.cpp",
430 ],
431)
432
benjaminwagner56f6d062016-01-13 10:45:19 -0800433DM_SRCS_IOS = struct()
434
435################################################################################
436## DM_INCLUDES
437################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700438
benjaminwagner6f6bef82015-10-15 08:09:44 -0700439DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800440 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700441 "gm",
442 "src/codec",
443 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800444 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700445 "src/fonts",
446 "src/pathops",
447 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700448 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800449 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700450 "tests",
451 "tools",
452 "tools/flags",
453 "tools/timer",
454]
455
benjaminwagner56f6d062016-01-13 10:45:19 -0800456################################################################################
457## DM_ARGS
458################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700459
benjaminwagner56f6d062016-01-13 10:45:19 -0800460def DM_ARGS(base_dir):
461 return [
462 "--nogpu",
463 "--verbose",
464 # TODO(mtklein): maybe investigate why these fail?
benjaminwagnerf6bfccd2016-02-25 10:28:11 -0800465 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText",
benjaminwagner56f6d062016-01-13 10:45:19 -0800466 "--resourcePath %s/resources" % base_dir,
467 "--images %s/resources" % base_dir,
468 ]
469
470################################################################################
471## COPTS
472################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800473
benjaminwagner86ea33e2015-10-26 10:46:25 -0700474COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700475 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700476 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700477]
478
benjaminwagner56f6d062016-01-13 10:45:19 -0800479COPTS_ANDROID = ["-mfpu=neon"]
480
481COPTS_IOS = []
482
483COPTS_ALL = []
484
485################################################################################
486## DEFINES
487################################################################################
488
489DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800490 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800491 "SK_BUILD_FOR_UNIX",
492 "SK_SAMPLES_FOR_X",
493 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800494 "SK_CODEC_DECODES_GIF",
495 "SK_CODEC_DECODES_JPEG",
496 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800497 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800498 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800499]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700500
501DEFINES_ANDROID = [
502 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800503 "SK_CODEC_DECODES_GIF",
504 "SK_CODEC_DECODES_JPEG",
505 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800506 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800507 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700508]
509
iroth8b99ef42015-11-02 11:11:21 -0800510DEFINES_IOS = [
511 "SK_BUILD_FOR_IOS",
512 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800513 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800514]
515
benjaminwagner86ea33e2015-10-26 10:46:25 -0700516DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700517 # Chrome DEFINES.
518 "SK_USE_FLOATBITS",
519 "SK_USE_FREETYPE_EMBOLDEN",
reede8f30622016-03-23 18:59:25 -0700520 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
reed7b380d02016-03-21 13:25:16 -0700521 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
reedb95f5552016-03-21 08:30:19 -0700522 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700523 # Turn on a few Google3-specific build fixes.
524 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700525 # Staging flags for API changes
526 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
527 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
fmalita41c40962016-03-24 11:05:28 -0700528 "SK_SUPPORT_LEGACY_PICTURE_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700529]
530
benjaminwagner56f6d062016-01-13 10:45:19 -0800531################################################################################
532## LINKOPTS
533################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700534
benjaminwagner56f6d062016-01-13 10:45:19 -0800535LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700536
benjaminwagner56f6d062016-01-13 10:45:19 -0800537LINKOPTS_ANDROID = [
538 "-lEGL",
539]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700540
benjaminwagner56f6d062016-01-13 10:45:19 -0800541LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700542
benjaminwagner56f6d062016-01-13 10:45:19 -0800543LINKOPTS_ALL = [
544 "-ldl",
545]