blob: b06c1dd938a9208d5ee079cfda801ab9455f8057 [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",
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",
152 "src/ports/*android*",
msarett6b4985c2016-03-10 07:15:59 -0800153 "src/ports/*CG*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700154 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700155 "src/ports/*mac*",
156 "src/ports/*mozalloc*",
157 "src/ports/*nacl*",
158 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800159 "src/ports/SkFontConfigInterface_direct_factory.cpp",
160 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700161 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
162 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800163 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800164 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800165 "src/ports/SkFontMgr_fontconfig_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700166 "src/ports/SkImageDecoder_WIC.cpp",
167 "src/ports/SkImageDecoder_empty.cpp",
168 "src/ports/SkImageGenerator_none.cpp",
169 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700170 ],
171)
172
benjaminwagner86ea33e2015-10-26 10:46:25 -0700173# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800174BASE_SRCS_ANDROID = struct(
175 include = [
irothd2ccc772016-01-25 11:24:57 -0800176 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800177 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800178 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800179 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700180 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700181 "src/opts/**/*.cpp",
182 "src/opts/**/*.h",
183 "src/ports/**/*.cpp",
184 "src/ports/**/*.h",
185 ],
186 exclude = [
187 "src/opts/*mips*",
188 "src/opts/*SSE2*",
189 "src/opts/*SSSE3*",
190 "src/opts/*ssse3*",
191 "src/opts/*SSE4*",
192 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800193 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700194 "src/opts/*x86*",
195 "src/opts/SkBitmapProcState_opts_none.cpp",
196 "src/opts/SkBlitMask_opts_none.cpp",
197 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800198 "src/ports/*CG*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700199 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700200 "src/ports/*fontconfig*",
201 "src/ports/*FontConfig*",
202 "src/ports/*mac*",
203 "src/ports/*mozalloc*",
204 "src/ports/*nacl*",
205 "src/ports/*win*",
206 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800207 "src/ports/SkFontConfigInterface_direct_factory.cpp",
208 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700209 "src/ports/SkFontMgr_custom_directory_factory.cpp",
210 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
211 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800212 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700213 "src/ports/SkImageDecoder_WIC.cpp",
214 "src/ports/SkImageDecoder_empty.cpp",
215 "src/ports/SkImageGenerator_none.cpp",
216 "src/ports/SkTLS_none.cpp",
217 ],
218)
219
iroth8b99ef42015-11-02 11:11:21 -0800220# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800221BASE_SRCS_IOS = struct(
222 include = [
msarett2775cf52016-02-17 14:14:25 -0800223 "src/android/*",
224 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800225 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
226 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800227 "src/opts/**/*.cpp",
228 "src/opts/**/*.h",
229 "src/ports/**/*.cpp",
230 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800231 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800232 ],
233 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800234 "src/codec/*Gif*.cpp",
235 "src/codec/*Ico*.cpp",
236 "src/codec/*Jpeg*.cpp",
237 "src/codec/*Webp*.cpp",
238 "src/codec/*Png*",
239 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800240 "src/opts/*mips*",
241 "src/opts/*NEON*",
242 "src/opts/*neon*",
243 "src/opts/*SSE2*",
244 "src/opts/*SSSE3*",
245 "src/opts/*ssse3*",
246 "src/opts/*SSE4*",
247 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800248 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800249 "src/opts/*x86*",
250 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800251 "src/opts/SkBlitMask_opts_arm*.cpp",
252 "src/opts/SkBlitRow_opts_arm*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800253 "src/ports/*android*",
254 "src/ports/*chromium*",
255 "src/ports/*fontconfig*",
256 "src/ports/*FontConfig*",
257 "src/ports/*FreeType*",
258 "src/ports/*mozalloc*",
259 "src/ports/*nacl*",
260 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800261 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800262 "src/ports/SkFontConfigInterface_direct_factory.cpp",
263 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800264 "src/ports/SkFontMgr_custom_directory_factory.cpp",
265 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
266 "src/ports/SkFontMgr_empty_factory.cpp",
267 "src/ports/SkImageDecoder_CG.cpp",
268 "src/ports/SkImageDecoder_WIC.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800269 "src/ports/SkImageGenerator_none.cpp",
270 "src/ports/SkTLS_none.cpp",
271 ],
272)
273
benjaminwagner56f6d062016-01-13 10:45:19 -0800274################################################################################
275## SSSE3/SSE4/AVX/AVX2 SRCS
276################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700277
benjaminwagner56f6d062016-01-13 10:45:19 -0800278SSSE3_SRCS = struct(
279 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700280 "src/opts/*SSSE3*.cpp",
281 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800282 ],
283)
mtkleind55d13a2015-08-18 08:51:49 -0700284
benjaminwagner56f6d062016-01-13 10:45:19 -0800285SSE4_SRCS = struct(
286 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700287 "src/opts/*SSE4*.cpp",
288 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800289 ],
290)
benjaminwagner787ca872015-08-17 12:58:10 -0700291
benjaminwagner56f6d062016-01-13 10:45:19 -0800292AVX_SRCS = struct(
293 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800294 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800295 ],
296)
mtkleinf6d8d282015-12-17 10:18:04 -0800297
benjaminwagner56f6d062016-01-13 10:45:19 -0800298AVX2_SRCS = struct(
299 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800300 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800301 ],
302)
mtkleinf6d8d282015-12-17 10:18:04 -0800303
benjaminwagner56f6d062016-01-13 10:45:19 -0800304################################################################################
305## BASE_HDRS
306################################################################################
307
308BASE_HDRS = struct(
309 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700310 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800311 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700312 ],
mtkleind55d13a2015-08-18 08:51:49 -0700313 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700314 "include/private/**/*",
315
316 # Not used.
317 "include/animator/**/*",
318 "include/views/**/*",
319 "include/xml/SkBML_WXMLParser.h",
320 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800321 ],
322)
benjaminwagner787ca872015-08-17 12:58:10 -0700323
benjaminwagner56f6d062016-01-13 10:45:19 -0800324################################################################################
325## BASE_DEPS
326################################################################################
327
328BASE_DEPS_ALL = []
329
benjaminwagner39e7aa42015-11-18 13:26:10 -0800330BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800331 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800332 ":opts_sse4",
333 ":opts_avx",
334 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800335]
336
337BASE_DEPS_ANDROID = []
338
339BASE_DEPS_IOS = []
340
benjaminwagner56f6d062016-01-13 10:45:19 -0800341################################################################################
342## INCLUDES
343################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800344
benjaminwagner787ca872015-08-17 12:58:10 -0700345# Includes needed by Skia implementation. Not public includes.
346INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800347 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700348 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800349 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700350 "include/codec",
351 "include/config",
352 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700353 "include/effects",
354 "include/gpu",
355 "include/images",
356 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700357 "include/pipe",
358 "include/ports",
359 "include/private",
360 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800361 "include/utils/mac",
362 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700363 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700364 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800365 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700366 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700367 "src/gpu",
368 "src/image",
369 "src/lazy",
370 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800371 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700372 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700373 "src/sfnt",
374 "src/utils",
375 "third_party/etc1",
376 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800377]
benjaminwagner787ca872015-08-17 12:58:10 -0700378
benjaminwagner56f6d062016-01-13 10:45:19 -0800379################################################################################
380## DM_SRCS
381################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700382
benjaminwagner56f6d062016-01-13 10:45:19 -0800383DM_SRCS_ALL = struct(
384 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700385 "dm/*.cpp",
386 "dm/*.h",
387 "gm/*.c",
388 "gm/*.cpp",
389 "gm/*.h",
390 "tests/*.cpp",
391 "tests/*.h",
392 "tools/CrashHandler.cpp",
393 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700394 "tools/ProcStats.cpp",
395 "tools/ProcStats.h",
396 "tools/Resources.cpp",
397 "tools/Resources.h",
benjaminwagner32885142015-10-24 07:55:31 -0700398 "tools/SkBitmapRegionCanvas.cpp",
399 "tools/SkBitmapRegionCanvas.h",
400 "tools/SkBitmapRegionCodec.cpp",
401 "tools/SkBitmapRegionCodec.h",
msarett5cb48852015-11-06 08:56:32 -0800402 "tools/SkBitmapRegionDecoder.cpp",
403 "tools/SkBitmapRegionDecoder.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700404 "tools/SkBitmapRegionSampler.cpp",
405 "tools/SkBitmapRegionSampler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700406 "tools/flags/*.cpp",
407 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800408 "tools/random_parse_path.cpp",
409 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700410 "tools/sk_tool_utils.cpp",
411 "tools/sk_tool_utils.h",
412 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700413 "tools/timer/*.cpp",
414 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700415 ],
416 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700417 "dm/DMSrcSinkAndroid.cpp", # Android-only.
418 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
419 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700420 "tests/skia_test.cpp", # Old main.
421 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700422 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700423 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700424 ],
425)
426
benjaminwagner56f6d062016-01-13 10:45:19 -0800427DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700428
benjaminwagner56f6d062016-01-13 10:45:19 -0800429DM_SRCS_ANDROID = struct(
430 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700431 # Depends on Android HWUI library that is not available in google3.
432 #"dm/DMSrcSinkAndroid.cpp",
433 "tests/FontMgrAndroidParserTest.cpp",
434 ],
435)
436
benjaminwagner56f6d062016-01-13 10:45:19 -0800437DM_SRCS_IOS = struct()
438
439################################################################################
440## DM_INCLUDES
441################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700442
benjaminwagner6f6bef82015-10-15 08:09:44 -0700443DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800444 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700445 "gm",
446 "src/codec",
447 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800448 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700449 "src/fonts",
450 "src/pathops",
451 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700452 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800453 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700454 "tests",
455 "tools",
456 "tools/flags",
457 "tools/timer",
458]
459
benjaminwagner56f6d062016-01-13 10:45:19 -0800460################################################################################
461## DM_ARGS
462################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700463
benjaminwagner56f6d062016-01-13 10:45:19 -0800464def DM_ARGS(base_dir):
465 return [
466 "--nogpu",
467 "--verbose",
468 # TODO(mtklein): maybe investigate why these fail?
benjaminwagnerf6bfccd2016-02-25 10:28:11 -0800469 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText",
benjaminwagner56f6d062016-01-13 10:45:19 -0800470 "--resourcePath %s/resources" % base_dir,
471 "--images %s/resources" % base_dir,
472 ]
473
474################################################################################
475## COPTS
476################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800477
benjaminwagner86ea33e2015-10-26 10:46:25 -0700478COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700479 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700480 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700481]
482
benjaminwagner56f6d062016-01-13 10:45:19 -0800483COPTS_ANDROID = ["-mfpu=neon"]
484
485COPTS_IOS = []
486
487COPTS_ALL = []
488
489################################################################################
490## DEFINES
491################################################################################
492
493DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800494 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800495 "SK_BUILD_FOR_UNIX",
496 "SK_SAMPLES_FOR_X",
497 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800498 "SK_CODEC_DECODES_GIF",
499 "SK_CODEC_DECODES_JPEG",
500 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800501 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800502 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800503]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700504
505DEFINES_ANDROID = [
506 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800507 "SK_CODEC_DECODES_GIF",
508 "SK_CODEC_DECODES_JPEG",
509 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800510 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800511 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700512]
513
iroth8b99ef42015-11-02 11:11:21 -0800514DEFINES_IOS = [
515 "SK_BUILD_FOR_IOS",
516 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800517 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800518]
519
benjaminwagner86ea33e2015-10-26 10:46:25 -0700520DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700521 # Chrome DEFINES.
522 "SK_USE_FLOATBITS",
523 "SK_USE_FREETYPE_EMBOLDEN",
524 # Turn on a few Google3-specific build fixes.
525 "GOOGLE3",
benjaminwagner787ca872015-08-17 12:58:10 -0700526]
527
benjaminwagner56f6d062016-01-13 10:45:19 -0800528################################################################################
529## LINKOPTS
530################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700531
benjaminwagner56f6d062016-01-13 10:45:19 -0800532LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700533
benjaminwagner56f6d062016-01-13 10:45:19 -0800534LINKOPTS_ANDROID = [
535 "-lEGL",
536]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700537
benjaminwagner56f6d062016-01-13 10:45:19 -0800538LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700539
benjaminwagner56f6d062016-01-13 10:45:19 -0800540LINKOPTS_ALL = [
541 "-ldl",
542]