blob: a8913fc54f5472289ee9acd050ef05ff5a6269cb [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 = [
msarett2775cf52016-02-17 14:14:25 -0800218 "src/android/*",
219 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800220 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
221 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800222 "src/opts/**/*.cpp",
223 "src/opts/**/*.h",
224 "src/ports/**/*.cpp",
225 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800226 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800227 ],
228 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800229 "src/codec/*Gif*.cpp",
230 "src/codec/*Ico*.cpp",
231 "src/codec/*Jpeg*.cpp",
232 "src/codec/*Webp*.cpp",
233 "src/codec/*Png*",
234 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800235 "src/opts/*mips*",
236 "src/opts/*NEON*",
237 "src/opts/*neon*",
238 "src/opts/*SSE2*",
239 "src/opts/*SSSE3*",
240 "src/opts/*ssse3*",
241 "src/opts/*SSE4*",
242 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800243 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800244 "src/opts/*x86*",
245 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800246 "src/opts/SkBlitMask_opts_arm*.cpp",
247 "src/opts/SkBlitRow_opts_arm*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800248 "src/ports/*android*",
249 "src/ports/*chromium*",
250 "src/ports/*fontconfig*",
251 "src/ports/*FontConfig*",
252 "src/ports/*FreeType*",
253 "src/ports/*mozalloc*",
254 "src/ports/*nacl*",
255 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800256 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800257 "src/ports/SkFontConfigInterface_direct_factory.cpp",
258 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800259 "src/ports/SkFontMgr_custom_directory_factory.cpp",
260 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
261 "src/ports/SkFontMgr_empty_factory.cpp",
262 "src/ports/SkImageDecoder_CG.cpp",
263 "src/ports/SkImageDecoder_WIC.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800264 "src/ports/SkImageGenerator_none.cpp",
265 "src/ports/SkTLS_none.cpp",
266 ],
267)
268
benjaminwagner56f6d062016-01-13 10:45:19 -0800269################################################################################
270## SSSE3/SSE4/AVX/AVX2 SRCS
271################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700272
benjaminwagner56f6d062016-01-13 10:45:19 -0800273SSSE3_SRCS = struct(
274 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700275 "src/opts/*SSSE3*.cpp",
276 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800277 ],
278)
mtkleind55d13a2015-08-18 08:51:49 -0700279
benjaminwagner56f6d062016-01-13 10:45:19 -0800280SSE4_SRCS = struct(
281 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700282 "src/opts/*SSE4*.cpp",
283 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800284 ],
285)
benjaminwagner787ca872015-08-17 12:58:10 -0700286
benjaminwagner56f6d062016-01-13 10:45:19 -0800287AVX_SRCS = struct(
288 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800289 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800290 ],
291)
mtkleinf6d8d282015-12-17 10:18:04 -0800292
benjaminwagner56f6d062016-01-13 10:45:19 -0800293AVX2_SRCS = struct(
294 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800295 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800296 ],
297)
mtkleinf6d8d282015-12-17 10:18:04 -0800298
benjaminwagner56f6d062016-01-13 10:45:19 -0800299################################################################################
300## BASE_HDRS
301################################################################################
302
303BASE_HDRS = struct(
304 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700305 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800306 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700307 ],
mtkleind55d13a2015-08-18 08:51:49 -0700308 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700309 "include/private/**/*",
310
311 # Not used.
312 "include/animator/**/*",
313 "include/views/**/*",
314 "include/xml/SkBML_WXMLParser.h",
315 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800316 ],
317)
benjaminwagner787ca872015-08-17 12:58:10 -0700318
benjaminwagner56f6d062016-01-13 10:45:19 -0800319################################################################################
320## BASE_DEPS
321################################################################################
322
323BASE_DEPS_ALL = []
324
benjaminwagner39e7aa42015-11-18 13:26:10 -0800325BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800326 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800327 ":opts_sse4",
328 ":opts_avx",
329 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800330]
331
332BASE_DEPS_ANDROID = []
333
334BASE_DEPS_IOS = []
335
benjaminwagner56f6d062016-01-13 10:45:19 -0800336################################################################################
337## INCLUDES
338################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800339
benjaminwagner787ca872015-08-17 12:58:10 -0700340# Includes needed by Skia implementation. Not public includes.
341INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800342 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700343 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800344 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700345 "include/codec",
346 "include/config",
347 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700348 "include/effects",
349 "include/gpu",
350 "include/images",
351 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700352 "include/pipe",
353 "include/ports",
354 "include/private",
355 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800356 "include/utils/mac",
357 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700358 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700359 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800360 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700361 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700362 "src/gpu",
363 "src/image",
364 "src/lazy",
365 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800366 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700367 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700368 "src/sfnt",
369 "src/utils",
370 "third_party/etc1",
371 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800372]
benjaminwagner787ca872015-08-17 12:58:10 -0700373
benjaminwagner56f6d062016-01-13 10:45:19 -0800374################################################################################
375## DM_SRCS
376################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700377
benjaminwagner56f6d062016-01-13 10:45:19 -0800378DM_SRCS_ALL = struct(
379 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700380 "dm/*.cpp",
381 "dm/*.h",
382 "gm/*.c",
383 "gm/*.cpp",
384 "gm/*.h",
385 "tests/*.cpp",
386 "tests/*.h",
387 "tools/CrashHandler.cpp",
388 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700389 "tools/ProcStats.cpp",
390 "tools/ProcStats.h",
391 "tools/Resources.cpp",
392 "tools/Resources.h",
benjaminwagner32885142015-10-24 07:55:31 -0700393 "tools/SkBitmapRegionCanvas.cpp",
394 "tools/SkBitmapRegionCanvas.h",
395 "tools/SkBitmapRegionCodec.cpp",
396 "tools/SkBitmapRegionCodec.h",
msarett5cb48852015-11-06 08:56:32 -0800397 "tools/SkBitmapRegionDecoder.cpp",
398 "tools/SkBitmapRegionDecoder.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700399 "tools/SkBitmapRegionSampler.cpp",
400 "tools/SkBitmapRegionSampler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700401 "tools/flags/*.cpp",
402 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800403 "tools/random_parse_path.cpp",
404 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700405 "tools/sk_tool_utils.cpp",
406 "tools/sk_tool_utils.h",
407 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700408 "tools/timer/*.cpp",
409 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700410 ],
411 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700412 "dm/DMSrcSinkAndroid.cpp", # Android-only.
413 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
414 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700415 "tests/skia_test.cpp", # Old main.
416 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700417 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700418 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700419 ],
420)
421
benjaminwagner56f6d062016-01-13 10:45:19 -0800422DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700423
benjaminwagner56f6d062016-01-13 10:45:19 -0800424DM_SRCS_ANDROID = struct(
425 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700426 # Depends on Android HWUI library that is not available in google3.
427 #"dm/DMSrcSinkAndroid.cpp",
428 "tests/FontMgrAndroidParserTest.cpp",
429 ],
430)
431
benjaminwagner56f6d062016-01-13 10:45:19 -0800432DM_SRCS_IOS = struct()
433
434################################################################################
435## DM_INCLUDES
436################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700437
benjaminwagner6f6bef82015-10-15 08:09:44 -0700438DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800439 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700440 "gm",
441 "src/codec",
442 "src/effects",
443 "src/fonts",
444 "src/pathops",
445 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700446 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800447 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700448 "tests",
449 "tools",
450 "tools/flags",
451 "tools/timer",
452]
453
benjaminwagner56f6d062016-01-13 10:45:19 -0800454################################################################################
455## DM_ARGS
456################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700457
benjaminwagner56f6d062016-01-13 10:45:19 -0800458def DM_ARGS(base_dir):
459 return [
460 "--nogpu",
461 "--verbose",
462 # TODO(mtklein): maybe investigate why these fail?
463 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds",
464 "--resourcePath %s/resources" % base_dir,
465 "--images %s/resources" % base_dir,
466 ]
467
468################################################################################
469## COPTS
470################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800471
benjaminwagner86ea33e2015-10-26 10:46:25 -0700472COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700473 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700474 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700475]
476
benjaminwagner56f6d062016-01-13 10:45:19 -0800477COPTS_ANDROID = ["-mfpu=neon"]
478
479COPTS_IOS = []
480
481COPTS_ALL = []
482
483################################################################################
484## DEFINES
485################################################################################
486
487DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800488 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800489 "SK_BUILD_FOR_UNIX",
490 "SK_SAMPLES_FOR_X",
491 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800492 "SK_CODEC_DECODES_GIF",
493 "SK_CODEC_DECODES_JPEG",
494 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800495 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800496 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800497]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700498
499DEFINES_ANDROID = [
500 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800501 "SK_CODEC_DECODES_GIF",
502 "SK_CODEC_DECODES_JPEG",
503 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800504 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800505 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700506]
507
iroth8b99ef42015-11-02 11:11:21 -0800508DEFINES_IOS = [
509 "SK_BUILD_FOR_IOS",
510 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800511 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800512]
513
benjaminwagner86ea33e2015-10-26 10:46:25 -0700514DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700515 # Chrome DEFINES.
516 "SK_USE_FLOATBITS",
517 "SK_USE_FREETYPE_EMBOLDEN",
518 # Turn on a few Google3-specific build fixes.
519 "GOOGLE3",
benjaminwagner787ca872015-08-17 12:58:10 -0700520]
521
benjaminwagner56f6d062016-01-13 10:45:19 -0800522################################################################################
523## LINKOPTS
524################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700525
benjaminwagner56f6d062016-01-13 10:45:19 -0800526LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700527
benjaminwagner56f6d062016-01-13 10:45:19 -0800528LINKOPTS_ANDROID = [
529 "-lEGL",
530]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700531
benjaminwagner56f6d062016-01-13 10:45:19 -0800532LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700533
benjaminwagner56f6d062016-01-13 10:45:19 -0800534LINKOPTS_ALL = [
535 "-ldl",
536]