blob: 986bfd93421065cdae70d180eb3d6274c9fff8e5 [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*",
153 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700154 "src/ports/*mac*",
155 "src/ports/*mozalloc*",
156 "src/ports/*nacl*",
157 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800158 "src/ports/SkFontConfigInterface_direct_factory.cpp",
159 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700160 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
161 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800162 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800163 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800164 "src/ports/SkFontMgr_fontconfig_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700165 "src/ports/SkImageDecoder_WIC.cpp",
166 "src/ports/SkImageDecoder_empty.cpp",
167 "src/ports/SkImageGenerator_none.cpp",
168 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700169 ],
170)
171
benjaminwagner86ea33e2015-10-26 10:46:25 -0700172# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800173BASE_SRCS_ANDROID = struct(
174 include = [
irothd2ccc772016-01-25 11:24:57 -0800175 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800176 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800177 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800178 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700179 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700180 "src/opts/**/*.cpp",
181 "src/opts/**/*.h",
182 "src/ports/**/*.cpp",
183 "src/ports/**/*.h",
184 ],
185 exclude = [
186 "src/opts/*mips*",
187 "src/opts/*SSE2*",
188 "src/opts/*SSSE3*",
189 "src/opts/*ssse3*",
190 "src/opts/*SSE4*",
191 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800192 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700193 "src/opts/*x86*",
194 "src/opts/SkBitmapProcState_opts_none.cpp",
195 "src/opts/SkBlitMask_opts_none.cpp",
196 "src/opts/SkBlitRow_opts_none.cpp",
197 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700198 "src/ports/*fontconfig*",
199 "src/ports/*FontConfig*",
200 "src/ports/*mac*",
201 "src/ports/*mozalloc*",
202 "src/ports/*nacl*",
203 "src/ports/*win*",
204 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800205 "src/ports/SkFontConfigInterface_direct_factory.cpp",
206 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700207 "src/ports/SkFontMgr_custom_directory_factory.cpp",
208 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
209 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800210 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700211 "src/ports/SkImageDecoder_WIC.cpp",
212 "src/ports/SkImageDecoder_empty.cpp",
213 "src/ports/SkImageGenerator_none.cpp",
214 "src/ports/SkTLS_none.cpp",
215 ],
216)
217
iroth8b99ef42015-11-02 11:11:21 -0800218# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800219BASE_SRCS_IOS = struct(
220 include = [
msarett2775cf52016-02-17 14:14:25 -0800221 "src/android/*",
222 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800223 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
224 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800225 "src/opts/**/*.cpp",
226 "src/opts/**/*.h",
227 "src/ports/**/*.cpp",
228 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800229 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800230 ],
231 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800232 "src/codec/*Gif*.cpp",
233 "src/codec/*Ico*.cpp",
234 "src/codec/*Jpeg*.cpp",
235 "src/codec/*Webp*.cpp",
236 "src/codec/*Png*",
237 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800238 "src/opts/*mips*",
239 "src/opts/*NEON*",
240 "src/opts/*neon*",
241 "src/opts/*SSE2*",
242 "src/opts/*SSSE3*",
243 "src/opts/*ssse3*",
244 "src/opts/*SSE4*",
245 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800246 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800247 "src/opts/*x86*",
248 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800249 "src/opts/SkBlitMask_opts_arm*.cpp",
250 "src/opts/SkBlitRow_opts_arm*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800251 "src/ports/*android*",
252 "src/ports/*chromium*",
253 "src/ports/*fontconfig*",
254 "src/ports/*FontConfig*",
255 "src/ports/*FreeType*",
256 "src/ports/*mozalloc*",
257 "src/ports/*nacl*",
258 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800259 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800260 "src/ports/SkFontConfigInterface_direct_factory.cpp",
261 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800262 "src/ports/SkFontMgr_custom_directory_factory.cpp",
263 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
264 "src/ports/SkFontMgr_empty_factory.cpp",
265 "src/ports/SkImageDecoder_CG.cpp",
266 "src/ports/SkImageDecoder_WIC.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800267 "src/ports/SkImageGenerator_none.cpp",
268 "src/ports/SkTLS_none.cpp",
269 ],
270)
271
benjaminwagner56f6d062016-01-13 10:45:19 -0800272################################################################################
273## SSSE3/SSE4/AVX/AVX2 SRCS
274################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700275
benjaminwagner56f6d062016-01-13 10:45:19 -0800276SSSE3_SRCS = struct(
277 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700278 "src/opts/*SSSE3*.cpp",
279 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800280 ],
281)
mtkleind55d13a2015-08-18 08:51:49 -0700282
benjaminwagner56f6d062016-01-13 10:45:19 -0800283SSE4_SRCS = struct(
284 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700285 "src/opts/*SSE4*.cpp",
286 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800287 ],
288)
benjaminwagner787ca872015-08-17 12:58:10 -0700289
benjaminwagner56f6d062016-01-13 10:45:19 -0800290AVX_SRCS = struct(
291 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800292 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800293 ],
294)
mtkleinf6d8d282015-12-17 10:18:04 -0800295
benjaminwagner56f6d062016-01-13 10:45:19 -0800296AVX2_SRCS = struct(
297 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800298 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800299 ],
300)
mtkleinf6d8d282015-12-17 10:18:04 -0800301
benjaminwagner56f6d062016-01-13 10:45:19 -0800302################################################################################
303## BASE_HDRS
304################################################################################
305
306BASE_HDRS = struct(
307 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700308 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800309 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700310 ],
mtkleind55d13a2015-08-18 08:51:49 -0700311 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700312 "include/private/**/*",
313
314 # Not used.
315 "include/animator/**/*",
316 "include/views/**/*",
317 "include/xml/SkBML_WXMLParser.h",
318 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800319 ],
320)
benjaminwagner787ca872015-08-17 12:58:10 -0700321
benjaminwagner56f6d062016-01-13 10:45:19 -0800322################################################################################
323## BASE_DEPS
324################################################################################
325
326BASE_DEPS_ALL = []
327
benjaminwagner39e7aa42015-11-18 13:26:10 -0800328BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800329 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800330 ":opts_sse4",
331 ":opts_avx",
332 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800333]
334
335BASE_DEPS_ANDROID = []
336
337BASE_DEPS_IOS = []
338
benjaminwagner56f6d062016-01-13 10:45:19 -0800339################################################################################
340## INCLUDES
341################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800342
benjaminwagner787ca872015-08-17 12:58:10 -0700343# Includes needed by Skia implementation. Not public includes.
344INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800345 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700346 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800347 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700348 "include/codec",
349 "include/config",
350 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700351 "include/effects",
352 "include/gpu",
353 "include/images",
354 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700355 "include/pipe",
356 "include/ports",
357 "include/private",
358 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800359 "include/utils/mac",
360 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700361 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700362 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800363 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700364 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700365 "src/gpu",
366 "src/image",
367 "src/lazy",
368 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800369 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700370 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700371 "src/sfnt",
372 "src/utils",
373 "third_party/etc1",
374 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800375]
benjaminwagner787ca872015-08-17 12:58:10 -0700376
benjaminwagner56f6d062016-01-13 10:45:19 -0800377################################################################################
378## DM_SRCS
379################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700380
benjaminwagner56f6d062016-01-13 10:45:19 -0800381DM_SRCS_ALL = struct(
382 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700383 "dm/*.cpp",
384 "dm/*.h",
385 "gm/*.c",
386 "gm/*.cpp",
387 "gm/*.h",
388 "tests/*.cpp",
389 "tests/*.h",
390 "tools/CrashHandler.cpp",
391 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700392 "tools/ProcStats.cpp",
393 "tools/ProcStats.h",
394 "tools/Resources.cpp",
395 "tools/Resources.h",
benjaminwagner32885142015-10-24 07:55:31 -0700396 "tools/SkBitmapRegionCanvas.cpp",
397 "tools/SkBitmapRegionCanvas.h",
398 "tools/SkBitmapRegionCodec.cpp",
399 "tools/SkBitmapRegionCodec.h",
msarett5cb48852015-11-06 08:56:32 -0800400 "tools/SkBitmapRegionDecoder.cpp",
401 "tools/SkBitmapRegionDecoder.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700402 "tools/SkBitmapRegionSampler.cpp",
403 "tools/SkBitmapRegionSampler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700404 "tools/flags/*.cpp",
405 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800406 "tools/random_parse_path.cpp",
407 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700408 "tools/sk_tool_utils.cpp",
409 "tools/sk_tool_utils.h",
410 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700411 "tools/timer/*.cpp",
412 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700413 ],
414 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700415 "dm/DMSrcSinkAndroid.cpp", # Android-only.
416 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
417 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700418 "tests/skia_test.cpp", # Old main.
419 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700420 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700421 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700422 ],
423)
424
benjaminwagner56f6d062016-01-13 10:45:19 -0800425DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700426
benjaminwagner56f6d062016-01-13 10:45:19 -0800427DM_SRCS_ANDROID = struct(
428 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700429 # Depends on Android HWUI library that is not available in google3.
430 #"dm/DMSrcSinkAndroid.cpp",
431 "tests/FontMgrAndroidParserTest.cpp",
432 ],
433)
434
benjaminwagner56f6d062016-01-13 10:45:19 -0800435DM_SRCS_IOS = struct()
436
437################################################################################
438## DM_INCLUDES
439################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700440
benjaminwagner6f6bef82015-10-15 08:09:44 -0700441DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800442 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700443 "gm",
444 "src/codec",
445 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800446 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700447 "src/fonts",
448 "src/pathops",
449 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700450 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800451 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700452 "tests",
453 "tools",
454 "tools/flags",
455 "tools/timer",
456]
457
benjaminwagner56f6d062016-01-13 10:45:19 -0800458################################################################################
459## DM_ARGS
460################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700461
benjaminwagner56f6d062016-01-13 10:45:19 -0800462def DM_ARGS(base_dir):
463 return [
464 "--nogpu",
465 "--verbose",
466 # TODO(mtklein): maybe investigate why these fail?
benjaminwagnerf6bfccd2016-02-25 10:28:11 -0800467 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText",
benjaminwagner56f6d062016-01-13 10:45:19 -0800468 "--resourcePath %s/resources" % base_dir,
469 "--images %s/resources" % base_dir,
470 ]
471
472################################################################################
473## COPTS
474################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800475
benjaminwagner86ea33e2015-10-26 10:46:25 -0700476COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700477 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700478 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700479]
480
benjaminwagner56f6d062016-01-13 10:45:19 -0800481COPTS_ANDROID = ["-mfpu=neon"]
482
483COPTS_IOS = []
484
485COPTS_ALL = []
486
487################################################################################
488## DEFINES
489################################################################################
490
491DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800492 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800493 "SK_BUILD_FOR_UNIX",
494 "SK_SAMPLES_FOR_X",
495 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800496 "SK_CODEC_DECODES_GIF",
497 "SK_CODEC_DECODES_JPEG",
498 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800499 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800500 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800501]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700502
503DEFINES_ANDROID = [
504 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800505 "SK_CODEC_DECODES_GIF",
506 "SK_CODEC_DECODES_JPEG",
507 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800508 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800509 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700510]
511
iroth8b99ef42015-11-02 11:11:21 -0800512DEFINES_IOS = [
513 "SK_BUILD_FOR_IOS",
514 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800515 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800516]
517
benjaminwagner86ea33e2015-10-26 10:46:25 -0700518DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700519 # Chrome DEFINES.
520 "SK_USE_FLOATBITS",
521 "SK_USE_FREETYPE_EMBOLDEN",
522 # Turn on a few Google3-specific build fixes.
523 "GOOGLE3",
benjaminwagner787ca872015-08-17 12:58:10 -0700524]
525
benjaminwagner56f6d062016-01-13 10:45:19 -0800526################################################################################
527## LINKOPTS
528################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700529
benjaminwagner56f6d062016-01-13 10:45:19 -0800530LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700531
benjaminwagner56f6d062016-01-13 10:45:19 -0800532LINKOPTS_ANDROID = [
533 "-lEGL",
534]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700535
benjaminwagner56f6d062016-01-13 10:45:19 -0800536LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700537
benjaminwagner56f6d062016-01-13 10:45:19 -0800538LINKOPTS_ALL = [
539 "-ldl",
540]