blob: 987d7c54903290b5ec70dd7ed235fe4dbd0d80d9 [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?
mtkleind55d13a2015-08-18 08:51:49 -070097 "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.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",
117 ],
118)
119
120# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800121BASE_SRCS_UNIX = struct(
122 include = [
irothd2ccc772016-01-25 11:24:57 -0800123 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800124 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800125 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth5f0de062016-02-17 12:47:27 -0800126 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800127 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700128 "src/opts/**/*.cpp",
129 "src/opts/**/*.h",
130 "src/ports/**/*.cpp",
131 "src/ports/**/*.h",
132 ],
133 exclude = [
134 "src/opts/*arm*",
135 "src/opts/*mips*",
136 "src/opts/*NEON*",
137 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700138 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700139 "src/opts/*SSSE3*",
140 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700141 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700142 "src/opts/*SSE4*",
143 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800144 # Included in :opts_avx or :opts_avx2
145 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700146 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700147 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700148 "src/opts/SkBlitRow_opts_none.cpp",
149 "src/ports/*android*",
150 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700151 "src/ports/*mac*",
152 "src/ports/*mozalloc*",
153 "src/ports/*nacl*",
154 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800155 "src/ports/SkFontConfigInterface_direct_factory.cpp",
156 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700157 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
158 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800159 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800160 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800161 "src/ports/SkFontMgr_fontconfig_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700162 "src/ports/SkImageDecoder_WIC.cpp",
163 "src/ports/SkImageDecoder_empty.cpp",
164 "src/ports/SkImageGenerator_none.cpp",
165 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700166 ],
167)
168
benjaminwagner86ea33e2015-10-26 10:46:25 -0700169# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800170BASE_SRCS_ANDROID = struct(
171 include = [
irothd2ccc772016-01-25 11:24:57 -0800172 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800173 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800174 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800175 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700176 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700177 "src/opts/**/*.cpp",
178 "src/opts/**/*.h",
179 "src/ports/**/*.cpp",
180 "src/ports/**/*.h",
181 ],
182 exclude = [
183 "src/opts/*mips*",
184 "src/opts/*SSE2*",
185 "src/opts/*SSSE3*",
186 "src/opts/*ssse3*",
187 "src/opts/*SSE4*",
188 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800189 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700190 "src/opts/*x86*",
191 "src/opts/SkBitmapProcState_opts_none.cpp",
192 "src/opts/SkBlitMask_opts_none.cpp",
193 "src/opts/SkBlitRow_opts_none.cpp",
194 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700195 "src/ports/*fontconfig*",
196 "src/ports/*FontConfig*",
197 "src/ports/*mac*",
198 "src/ports/*mozalloc*",
199 "src/ports/*nacl*",
200 "src/ports/*win*",
201 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800202 "src/ports/SkFontConfigInterface_direct_factory.cpp",
203 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700204 "src/ports/SkFontMgr_custom_directory_factory.cpp",
205 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
206 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800207 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700208 "src/ports/SkImageDecoder_WIC.cpp",
209 "src/ports/SkImageDecoder_empty.cpp",
210 "src/ports/SkImageGenerator_none.cpp",
211 "src/ports/SkTLS_none.cpp",
212 ],
213)
214
iroth8b99ef42015-11-02 11:11:21 -0800215# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800216BASE_SRCS_IOS = struct(
217 include = [
iroth5f0de062016-02-17 12:47:27 -0800218 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
219 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800220 "src/opts/**/*.cpp",
221 "src/opts/**/*.h",
222 "src/ports/**/*.cpp",
223 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800224 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800225 ],
226 exclude = [
227 "src/opts/*mips*",
228 "src/opts/*NEON*",
229 "src/opts/*neon*",
230 "src/opts/*SSE2*",
231 "src/opts/*SSSE3*",
232 "src/opts/*ssse3*",
233 "src/opts/*SSE4*",
234 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800235 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800236 "src/opts/*x86*",
237 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800238 "src/opts/SkBlitMask_opts_arm*.cpp",
239 "src/opts/SkBlitRow_opts_arm*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800240 "src/ports/*android*",
241 "src/ports/*chromium*",
242 "src/ports/*fontconfig*",
243 "src/ports/*FontConfig*",
244 "src/ports/*FreeType*",
245 "src/ports/*mozalloc*",
246 "src/ports/*nacl*",
247 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800248 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800249 "src/ports/SkFontConfigInterface_direct_factory.cpp",
250 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800251 "src/ports/SkFontMgr_custom_directory_factory.cpp",
252 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
253 "src/ports/SkFontMgr_empty_factory.cpp",
254 "src/ports/SkImageDecoder_CG.cpp",
255 "src/ports/SkImageDecoder_WIC.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800256 "src/ports/SkImageGenerator_none.cpp",
257 "src/ports/SkTLS_none.cpp",
258 ],
259)
260
benjaminwagner56f6d062016-01-13 10:45:19 -0800261################################################################################
262## SSSE3/SSE4/AVX/AVX2 SRCS
263################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700264
benjaminwagner56f6d062016-01-13 10:45:19 -0800265SSSE3_SRCS = struct(
266 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700267 "src/opts/*SSSE3*.cpp",
268 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800269 ],
270)
mtkleind55d13a2015-08-18 08:51:49 -0700271
benjaminwagner56f6d062016-01-13 10:45:19 -0800272SSE4_SRCS = struct(
273 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700274 "src/opts/*SSE4*.cpp",
275 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800276 ],
277)
benjaminwagner787ca872015-08-17 12:58:10 -0700278
benjaminwagner56f6d062016-01-13 10:45:19 -0800279AVX_SRCS = struct(
280 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800281 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800282 ],
283)
mtkleinf6d8d282015-12-17 10:18:04 -0800284
benjaminwagner56f6d062016-01-13 10:45:19 -0800285AVX2_SRCS = struct(
286 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800287 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800288 ],
289)
mtkleinf6d8d282015-12-17 10:18:04 -0800290
benjaminwagner56f6d062016-01-13 10:45:19 -0800291################################################################################
292## BASE_HDRS
293################################################################################
294
295BASE_HDRS = struct(
296 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700297 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800298 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700299 ],
mtkleind55d13a2015-08-18 08:51:49 -0700300 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700301 "include/private/**/*",
302
303 # Not used.
304 "include/animator/**/*",
305 "include/views/**/*",
306 "include/xml/SkBML_WXMLParser.h",
307 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800308 ],
309)
benjaminwagner787ca872015-08-17 12:58:10 -0700310
benjaminwagner56f6d062016-01-13 10:45:19 -0800311################################################################################
312## BASE_DEPS
313################################################################################
314
315BASE_DEPS_ALL = []
316
benjaminwagner39e7aa42015-11-18 13:26:10 -0800317BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800318 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800319 ":opts_sse4",
320 ":opts_avx",
321 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800322]
323
324BASE_DEPS_ANDROID = []
325
326BASE_DEPS_IOS = []
327
benjaminwagner56f6d062016-01-13 10:45:19 -0800328################################################################################
329## INCLUDES
330################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800331
benjaminwagner787ca872015-08-17 12:58:10 -0700332# Includes needed by Skia implementation. Not public includes.
333INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800334 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700335 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800336 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700337 "include/codec",
338 "include/config",
339 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700340 "include/effects",
341 "include/gpu",
342 "include/images",
343 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700344 "include/pipe",
345 "include/ports",
346 "include/private",
347 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800348 "include/utils/mac",
349 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700350 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700351 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800352 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700353 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700354 "src/gpu",
355 "src/image",
356 "src/lazy",
357 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800358 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700359 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700360 "src/sfnt",
361 "src/utils",
362 "third_party/etc1",
363 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800364]
benjaminwagner787ca872015-08-17 12:58:10 -0700365
benjaminwagner56f6d062016-01-13 10:45:19 -0800366################################################################################
367## DM_SRCS
368################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700369
benjaminwagner56f6d062016-01-13 10:45:19 -0800370DM_SRCS_ALL = struct(
371 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700372 "dm/*.cpp",
373 "dm/*.h",
374 "gm/*.c",
375 "gm/*.cpp",
376 "gm/*.h",
377 "tests/*.cpp",
378 "tests/*.h",
379 "tools/CrashHandler.cpp",
380 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700381 "tools/ProcStats.cpp",
382 "tools/ProcStats.h",
383 "tools/Resources.cpp",
384 "tools/Resources.h",
benjaminwagner32885142015-10-24 07:55:31 -0700385 "tools/SkBitmapRegionCanvas.cpp",
386 "tools/SkBitmapRegionCanvas.h",
387 "tools/SkBitmapRegionCodec.cpp",
388 "tools/SkBitmapRegionCodec.h",
msarett5cb48852015-11-06 08:56:32 -0800389 "tools/SkBitmapRegionDecoder.cpp",
390 "tools/SkBitmapRegionDecoder.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700391 "tools/SkBitmapRegionSampler.cpp",
392 "tools/SkBitmapRegionSampler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700393 "tools/flags/*.cpp",
394 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800395 "tools/random_parse_path.cpp",
396 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700397 "tools/sk_tool_utils.cpp",
398 "tools/sk_tool_utils.h",
399 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700400 "tools/timer/*.cpp",
401 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700402 ],
403 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700404 "dm/DMSrcSinkAndroid.cpp", # Android-only.
405 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
406 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700407 "tests/skia_test.cpp", # Old main.
408 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700409 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700410 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700411 ],
412)
413
benjaminwagner56f6d062016-01-13 10:45:19 -0800414DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700415
benjaminwagner56f6d062016-01-13 10:45:19 -0800416DM_SRCS_ANDROID = struct(
417 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700418 # Depends on Android HWUI library that is not available in google3.
419 #"dm/DMSrcSinkAndroid.cpp",
420 "tests/FontMgrAndroidParserTest.cpp",
421 ],
422)
423
benjaminwagner56f6d062016-01-13 10:45:19 -0800424DM_SRCS_IOS = struct()
425
426################################################################################
427## DM_INCLUDES
428################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700429
benjaminwagner6f6bef82015-10-15 08:09:44 -0700430DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800431 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700432 "gm",
433 "src/codec",
434 "src/effects",
435 "src/fonts",
436 "src/pathops",
437 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700438 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800439 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700440 "tests",
441 "tools",
442 "tools/flags",
443 "tools/timer",
444]
445
benjaminwagner56f6d062016-01-13 10:45:19 -0800446################################################################################
447## DM_ARGS
448################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700449
benjaminwagner56f6d062016-01-13 10:45:19 -0800450def DM_ARGS(base_dir):
451 return [
452 "--nogpu",
453 "--verbose",
454 # TODO(mtklein): maybe investigate why these fail?
455 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds",
456 "--resourcePath %s/resources" % base_dir,
457 "--images %s/resources" % base_dir,
458 ]
459
460################################################################################
461## COPTS
462################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800463
benjaminwagner86ea33e2015-10-26 10:46:25 -0700464COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700465 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700466 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700467]
468
benjaminwagner56f6d062016-01-13 10:45:19 -0800469COPTS_ANDROID = ["-mfpu=neon"]
470
471COPTS_IOS = []
472
473COPTS_ALL = []
474
475################################################################################
476## DEFINES
477################################################################################
478
479DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800480 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800481 "SK_BUILD_FOR_UNIX",
482 "SK_SAMPLES_FOR_X",
483 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800484 "SK_CODEC_DECODES_GIF",
485 "SK_CODEC_DECODES_JPEG",
486 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800487 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800488 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800489]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700490
491DEFINES_ANDROID = [
492 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800493 "SK_CODEC_DECODES_GIF",
494 "SK_CODEC_DECODES_JPEG",
495 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800496 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800497 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700498]
499
iroth8b99ef42015-11-02 11:11:21 -0800500DEFINES_IOS = [
501 "SK_BUILD_FOR_IOS",
502 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800503 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800504]
505
benjaminwagner86ea33e2015-10-26 10:46:25 -0700506DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700507 # Chrome DEFINES.
508 "SK_USE_FLOATBITS",
509 "SK_USE_FREETYPE_EMBOLDEN",
510 # Turn on a few Google3-specific build fixes.
511 "GOOGLE3",
benjaminwagner787ca872015-08-17 12:58:10 -0700512]
513
benjaminwagner56f6d062016-01-13 10:45:19 -0800514################################################################################
515## LINKOPTS
516################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700517
benjaminwagner56f6d062016-01-13 10:45:19 -0800518LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700519
benjaminwagner56f6d062016-01-13 10:45:19 -0800520LINKOPTS_ANDROID = [
521 "-lEGL",
522]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700523
benjaminwagner56f6d062016-01-13 10:45:19 -0800524LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700525
benjaminwagner56f6d062016-01-13 10:45:19 -0800526LINKOPTS_ALL = [
527 "-ldl",
528]