blob: f55cd35e17383a32dcdf7bfb8f68c985d59d2724 [file] [log] [blame]
benjaminwagner56f6d062016-01-13 10:45:19 -08001################################################################################
2# Skylark macros
3################################################################################
benjaminwagner787ca872015-08-17 12:58:10 -07004
benjaminwagner56f6d062016-01-13 10:45:19 -08005is_bazel = not hasattr(native, "genmpm")
6
7def portable_select(select_dict, bazel_condition, default_condition):
8 """Replaces select() with a Bazel-friendly wrapper.
9
10 Args:
11 select_dict: Dictionary in the same format as select().
12 Returns:
13 If Blaze platform, returns select() using select_dict.
14 If Bazel platform, returns dependencies for condition
15 bazel_condition, or empty list if none specified.
16 """
17 if is_bazel:
18 return select_dict.get(bazel_condition, select_dict[default_condition])
19 else:
20 return select(select_dict)
21
22def skia_select(conditions, results):
23 """Replaces select() for conditions [UNIX, ANDROID, IOS]
24
25 Args:
26 conditions: [CONDITION_UNIX, CONDITION_ANDROID, CONDITION_IOS]
27 results: [RESULT_UNIX, RESULT_ANDROID, RESULT_IOS]
28 Returns:
29 The result matching the platform condition.
30 """
31 if len(conditions) != 3 or len(results) != 3:
32 fail("Must provide exactly 3 conditions and 3 results")
33
34 selector = {}
35 for i in range(3):
36 selector[conditions[i]] = results[i]
37 return portable_select(selector, conditions[2], conditions[0])
38
39def skia_glob(srcs):
40 """Replaces glob() with a version that accepts a struct.
41
42 Args:
43 srcs: struct(include=[], exclude=[])
44 Returns:
45 Equivalent of glob(srcs.include, exclude=srcs.exclude)
46 """
47 if hasattr(srcs, 'include'):
48 if hasattr(srcs, 'exclude'):
49 return native.glob(srcs.include, exclude=srcs.exclude)
50 else:
51 return native.glob(srcs.include)
52 return []
53
54################################################################################
55## BASE_SRCS
56################################################################################
benjaminwagner787ca872015-08-17 12:58:10 -070057
benjaminwagner39e7aa42015-11-18 13:26:10 -080058# All platform-independent SRCS.
benjaminwagner56f6d062016-01-13 10:45:19 -080059BASE_SRCS_ALL = struct(
60 include = [
mtkleind55d13a2015-08-18 08:51:49 -070061 "include/private/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -070062 "src/**/*.h",
63 "src/**/*.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -070064
mtkleind55d13a2015-08-18 08:51:49 -070065 # Third Party
benjaminwagner787ca872015-08-17 12:58:10 -070066 "third_party/etc1/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070067 "third_party/etc1/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070068 "third_party/ktx/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070069 "third_party/ktx/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070070 ],
71 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -070072 # Exclude platform-dependent files.
irothd2ccc772016-01-25 11:24:57 -080073 "src/android/*",
iroth76a12252016-01-07 07:11:39 -080074 "src/codec/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070075 "src/device/xps/*", # Windows-only. Move to ports?
76 "src/doc/*_XPS.cpp", # Windows-only. Move to ports?
benjaminwagner2211a7b2015-12-01 11:12:05 -080077 "src/fonts/SkFontMgr_fontconfig.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070078 "src/gpu/gl/android/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -070079 "src/gpu/gl/egl/*",
80 "src/gpu/gl/glx/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070081 "src/gpu/gl/iOS/*",
82 "src/gpu/gl/mac/*",
83 "src/gpu/gl/win/*",
iroth76a12252016-01-07 07:11:39 -080084 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070085 "src/opts/**/*",
86 "src/ports/**/*",
87 "src/utils/android/**/*",
88 "src/utils/mac/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070089 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
90 "src/utils/win/**/*",
91 "src/views/sdl/*",
92 "src/views/win/*",
93 "src/views/unix/*",
94
95 # Exclude multiple definitions.
96 # TODO(mtklein): Move to opts?
benjaminwagnerca26a182016-03-14 15:21:12 -070097 "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp.
benjaminwagner86ea33e2015-10-26 10:46:25 -070098 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
99 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
iroth5f0de062016-02-17 12:47:27 -0800100 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700101
102 # Exclude files that don't compile with the current DEFINES.
103 "src/gpu/gl/angle/*", # Requires SK_ANGLE define.
104 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE'
105 "src/gpu/gl/mesa/*", # Requires SK_MESA define.
106 "src/svg/parser/*", # Missing SkSVG.h.
107
benjaminwagner39e7aa42015-11-18 13:26:10 -0800108 # Conflicting dependencies among Lua versions. See cl/107087297.
109 "src/utils/SkLua*",
110
benjaminwagner6f6bef82015-10-15 08:09:44 -0700111 # Not used.
112 "src/animator/**/*",
113 "src/views/**/*",
114 "src/xml/SkBML_Verbs.h",
115 "src/xml/SkBML_XMLParser.cpp",
116 "src/xml/SkXMLPullParser.cpp",
egdaniel32119f12016-02-22 10:07:54 -0800117
118 # Currently exclude all vulkan specific files
119 "src/gpu/vk/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700120 ],
121)
122
123# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800124BASE_SRCS_UNIX = struct(
125 include = [
irothd2ccc772016-01-25 11:24:57 -0800126 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800127 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800128 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth5f0de062016-02-17 12:47:27 -0800129 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800130 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700131 "src/opts/**/*.cpp",
132 "src/opts/**/*.h",
133 "src/ports/**/*.cpp",
134 "src/ports/**/*.h",
135 ],
136 exclude = [
137 "src/opts/*arm*",
138 "src/opts/*mips*",
139 "src/opts/*NEON*",
140 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700141 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700142 "src/opts/*SSSE3*",
143 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700144 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700145 "src/opts/*SSE4*",
146 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800147 # Included in :opts_avx or :opts_avx2
148 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700149 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700150 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700151 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800152 "src/ports/*CG*",
msarettfc0b6d12016-03-17 13:50:17 -0700153 "src/ports/*WIC*",
mtklein3f193a92016-03-10 08:52:05 -0800154 "src/ports/*android*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700155 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700156 "src/ports/*mac*",
157 "src/ports/*mozalloc*",
158 "src/ports/*nacl*",
159 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800160 "src/ports/SkFontConfigInterface_direct_factory.cpp",
161 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700162 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700163 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700164 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800165 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800166 "src/ports/SkFontMgr_fontconfig_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700167 "src/ports/SkImageDecoder_empty.cpp",
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*",
mtklein3f193a92016-03-10 08:52:05 -0800199 "src/ports/*FontConfig*",
msarettfc0b6d12016-03-17 13:50:17 -0700200 "src/ports/*WIC*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700201 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700202 "src/ports/*fontconfig*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700203 "src/ports/*mac*",
204 "src/ports/*mozalloc*",
205 "src/ports/*nacl*",
206 "src/ports/*win*",
207 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800208 "src/ports/SkFontConfigInterface_direct_factory.cpp",
209 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700210 "src/ports/SkFontMgr_custom_directory_factory.cpp",
211 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700212 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700213 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700214 "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",
mtklein3f193a92016-03-10 08:52:05 -0800253 "src/ports/*CG*",
254 "src/ports/*FontConfig*",
255 "src/ports/*FreeType*",
msarettfc0b6d12016-03-17 13:50:17 -0700256 "src/ports/*WIC*",
iroth8b99ef42015-11-02 11:11:21 -0800257 "src/ports/*android*",
258 "src/ports/*chromium*",
259 "src/ports/*fontconfig*",
iroth8b99ef42015-11-02 11:11:21 -0800260 "src/ports/*mozalloc*",
261 "src/ports/*nacl*",
262 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800263 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800264 "src/ports/SkFontConfigInterface_direct_factory.cpp",
265 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800266 "src/ports/SkFontMgr_custom_directory_factory.cpp",
267 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700268 "src/ports/SkFontMgr_custom_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800269 "src/ports/SkFontMgr_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800270 "src/ports/SkImageGenerator_none.cpp",
271 "src/ports/SkTLS_none.cpp",
272 ],
273)
274
benjaminwagner56f6d062016-01-13 10:45:19 -0800275################################################################################
276## SSSE3/SSE4/AVX/AVX2 SRCS
277################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700278
benjaminwagner56f6d062016-01-13 10:45:19 -0800279SSSE3_SRCS = struct(
280 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700281 "src/opts/*SSSE3*.cpp",
282 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800283 ],
284)
mtkleind55d13a2015-08-18 08:51:49 -0700285
benjaminwagner56f6d062016-01-13 10:45:19 -0800286SSE4_SRCS = struct(
287 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700288 "src/opts/*SSE4*.cpp",
289 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800290 ],
291)
benjaminwagner787ca872015-08-17 12:58:10 -0700292
benjaminwagner56f6d062016-01-13 10:45:19 -0800293AVX_SRCS = struct(
294 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800295 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800296 ],
297)
mtkleinf6d8d282015-12-17 10:18:04 -0800298
benjaminwagner56f6d062016-01-13 10:45:19 -0800299AVX2_SRCS = struct(
300 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800301 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800302 ],
303)
mtkleinf6d8d282015-12-17 10:18:04 -0800304
benjaminwagner56f6d062016-01-13 10:45:19 -0800305################################################################################
306## BASE_HDRS
307################################################################################
308
309BASE_HDRS = struct(
310 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700311 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800312 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700313 ],
mtkleind55d13a2015-08-18 08:51:49 -0700314 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700315 "include/private/**/*",
316
317 # Not used.
318 "include/animator/**/*",
319 "include/views/**/*",
320 "include/xml/SkBML_WXMLParser.h",
321 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800322 ],
323)
benjaminwagner787ca872015-08-17 12:58:10 -0700324
benjaminwagner56f6d062016-01-13 10:45:19 -0800325################################################################################
326## BASE_DEPS
327################################################################################
328
329BASE_DEPS_ALL = []
330
benjaminwagner39e7aa42015-11-18 13:26:10 -0800331BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800332 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800333 ":opts_sse4",
334 ":opts_avx",
335 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800336]
337
338BASE_DEPS_ANDROID = []
339
340BASE_DEPS_IOS = []
341
benjaminwagner56f6d062016-01-13 10:45:19 -0800342################################################################################
343## INCLUDES
344################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800345
benjaminwagner787ca872015-08-17 12:58:10 -0700346# Includes needed by Skia implementation. Not public includes.
347INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800348 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700349 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800350 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700351 "include/codec",
352 "include/config",
353 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700354 "include/effects",
355 "include/gpu",
356 "include/images",
357 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700358 "include/pipe",
359 "include/ports",
360 "include/private",
361 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800362 "include/utils/mac",
363 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700364 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700365 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800366 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700367 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700368 "src/gpu",
369 "src/image",
370 "src/lazy",
371 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800372 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700373 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700374 "src/sfnt",
375 "src/utils",
376 "third_party/etc1",
377 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800378]
benjaminwagner787ca872015-08-17 12:58:10 -0700379
benjaminwagner56f6d062016-01-13 10:45:19 -0800380################################################################################
381## DM_SRCS
382################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700383
benjaminwagner56f6d062016-01-13 10:45:19 -0800384DM_SRCS_ALL = struct(
385 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700386 "dm/*.cpp",
387 "dm/*.h",
388 "gm/*.c",
389 "gm/*.cpp",
390 "gm/*.h",
391 "tests/*.cpp",
392 "tests/*.h",
393 "tools/CrashHandler.cpp",
394 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700395 "tools/ProcStats.cpp",
396 "tools/ProcStats.h",
397 "tools/Resources.cpp",
398 "tools/Resources.h",
benjaminwagner32885142015-10-24 07:55:31 -0700399 "tools/SkBitmapRegionCanvas.cpp",
400 "tools/SkBitmapRegionCanvas.h",
401 "tools/SkBitmapRegionCodec.cpp",
402 "tools/SkBitmapRegionCodec.h",
msarett5cb48852015-11-06 08:56:32 -0800403 "tools/SkBitmapRegionDecoder.cpp",
404 "tools/SkBitmapRegionDecoder.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700405 "tools/SkBitmapRegionSampler.cpp",
406 "tools/SkBitmapRegionSampler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700407 "tools/flags/*.cpp",
408 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800409 "tools/random_parse_path.cpp",
410 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700411 "tools/sk_tool_utils.cpp",
412 "tools/sk_tool_utils.h",
413 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700414 "tools/timer/*.cpp",
415 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700416 ],
417 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700418 "dm/DMSrcSinkAndroid.cpp", # Android-only.
419 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
420 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700421 "tests/skia_test.cpp", # Old main.
422 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700423 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700424 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700425 ],
426)
427
benjaminwagner56f6d062016-01-13 10:45:19 -0800428DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700429
benjaminwagner56f6d062016-01-13 10:45:19 -0800430DM_SRCS_ANDROID = struct(
431 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700432 # Depends on Android HWUI library that is not available in google3.
433 #"dm/DMSrcSinkAndroid.cpp",
434 "tests/FontMgrAndroidParserTest.cpp",
435 ],
436)
437
benjaminwagner56f6d062016-01-13 10:45:19 -0800438DM_SRCS_IOS = struct()
439
440################################################################################
441## DM_INCLUDES
442################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700443
benjaminwagner6f6bef82015-10-15 08:09:44 -0700444DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800445 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700446 "gm",
447 "src/codec",
448 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800449 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700450 "src/fonts",
451 "src/pathops",
452 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700453 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800454 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700455 "tests",
456 "tools",
457 "tools/flags",
458 "tools/timer",
459]
460
benjaminwagner56f6d062016-01-13 10:45:19 -0800461################################################################################
462## DM_ARGS
463################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700464
benjaminwagner56f6d062016-01-13 10:45:19 -0800465def DM_ARGS(base_dir):
466 return [
467 "--nogpu",
468 "--verbose",
469 # TODO(mtklein): maybe investigate why these fail?
benjaminwagnerf6bfccd2016-02-25 10:28:11 -0800470 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText",
benjaminwagner56f6d062016-01-13 10:45:19 -0800471 "--resourcePath %s/resources" % base_dir,
472 "--images %s/resources" % base_dir,
473 ]
474
475################################################################################
476## COPTS
477################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800478
benjaminwagner86ea33e2015-10-26 10:46:25 -0700479COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700480 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700481 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700482]
483
benjaminwagner56f6d062016-01-13 10:45:19 -0800484COPTS_ANDROID = ["-mfpu=neon"]
485
486COPTS_IOS = []
487
488COPTS_ALL = []
489
490################################################################################
491## DEFINES
492################################################################################
493
494DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800495 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800496 "SK_BUILD_FOR_UNIX",
497 "SK_SAMPLES_FOR_X",
498 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800499 "SK_CODEC_DECODES_GIF",
500 "SK_CODEC_DECODES_JPEG",
501 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800502 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800503 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800504]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700505
506DEFINES_ANDROID = [
507 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800508 "SK_CODEC_DECODES_GIF",
509 "SK_CODEC_DECODES_JPEG",
510 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800511 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800512 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700513]
514
iroth8b99ef42015-11-02 11:11:21 -0800515DEFINES_IOS = [
516 "SK_BUILD_FOR_IOS",
517 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800518 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800519]
520
benjaminwagner86ea33e2015-10-26 10:46:25 -0700521DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700522 # Chrome DEFINES.
523 "SK_USE_FLOATBITS",
524 "SK_USE_FREETYPE_EMBOLDEN",
reede8f30622016-03-23 18:59:25 -0700525 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
reed7b380d02016-03-21 13:25:16 -0700526 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
reedb95f5552016-03-21 08:30:19 -0700527 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700528 # Turn on a few Google3-specific build fixes.
529 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700530 # Staging flags for API changes
531 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
532 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700533]
534
benjaminwagner56f6d062016-01-13 10:45:19 -0800535################################################################################
536## LINKOPTS
537################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700538
benjaminwagner56f6d062016-01-13 10:45:19 -0800539LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700540
benjaminwagner56f6d062016-01-13 10:45:19 -0800541LINKOPTS_ANDROID = [
542 "-lEGL",
543]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700544
benjaminwagner56f6d062016-01-13 10:45:19 -0800545LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700546
benjaminwagner56f6d062016-01-13 10:45:19 -0800547LINKOPTS_ALL = [
548 "-ldl",
549]