blob: be43304d37e1a48ee87132939c85a4413190b510 [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/*",
benjaminwagneraf3b35e2016-03-28 13:27:28 -070080 "src/gpu/gl/glfw/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -070081 "src/gpu/gl/glx/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070082 "src/gpu/gl/iOS/*",
83 "src/gpu/gl/mac/*",
84 "src/gpu/gl/win/*",
iroth76a12252016-01-07 07:11:39 -080085 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070086 "src/opts/**/*",
87 "src/ports/**/*",
88 "src/utils/android/**/*",
89 "src/utils/mac/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070090 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
91 "src/utils/win/**/*",
92 "src/views/sdl/*",
93 "src/views/win/*",
94 "src/views/unix/*",
95
96 # Exclude multiple definitions.
97 # TODO(mtklein): Move to opts?
benjaminwagnerca26a182016-03-14 15:21:12 -070098 "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp.
benjaminwagner86ea33e2015-10-26 10:46:25 -070099 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
100 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
iroth5f0de062016-02-17 12:47:27 -0800101 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700102
103 # Exclude files that don't compile with the current DEFINES.
104 "src/gpu/gl/angle/*", # Requires SK_ANGLE define.
105 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE'
106 "src/gpu/gl/mesa/*", # Requires SK_MESA define.
107 "src/svg/parser/*", # Missing SkSVG.h.
108
benjaminwagner39e7aa42015-11-18 13:26:10 -0800109 # Conflicting dependencies among Lua versions. See cl/107087297.
110 "src/utils/SkLua*",
111
benjaminwagner6f6bef82015-10-15 08:09:44 -0700112 # Not used.
113 "src/animator/**/*",
114 "src/views/**/*",
115 "src/xml/SkBML_Verbs.h",
116 "src/xml/SkBML_XMLParser.cpp",
117 "src/xml/SkXMLPullParser.cpp",
egdaniel32119f12016-02-22 10:07:54 -0800118
119 # Currently exclude all vulkan specific files
120 "src/gpu/vk/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700121 ],
122)
123
124# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800125BASE_SRCS_UNIX = struct(
126 include = [
irothd2ccc772016-01-25 11:24:57 -0800127 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800128 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800129 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth5f0de062016-02-17 12:47:27 -0800130 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800131 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700132 "src/opts/**/*.cpp",
133 "src/opts/**/*.h",
134 "src/ports/**/*.cpp",
135 "src/ports/**/*.h",
136 ],
137 exclude = [
138 "src/opts/*arm*",
139 "src/opts/*mips*",
140 "src/opts/*NEON*",
141 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700142 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700143 "src/opts/*SSSE3*",
144 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700145 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700146 "src/opts/*SSE4*",
147 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800148 # Included in :opts_avx or :opts_avx2
149 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700150 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700151 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700152 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800153 "src/ports/*CG*",
msarettfc0b6d12016-03-17 13:50:17 -0700154 "src/ports/*WIC*",
mtklein3f193a92016-03-10 08:52:05 -0800155 "src/ports/*android*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700156 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700157 "src/ports/*mac*",
158 "src/ports/*mozalloc*",
159 "src/ports/*nacl*",
160 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800161 "src/ports/SkFontConfigInterface_direct_factory.cpp",
162 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700163 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700164 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700165 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800166 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800167 "src/ports/SkFontMgr_fontconfig_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700168 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700169 "src/ports/SkImageGenerator_none.cpp",
170 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700171 ],
172)
173
benjaminwagner86ea33e2015-10-26 10:46:25 -0700174# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800175BASE_SRCS_ANDROID = struct(
176 include = [
irothd2ccc772016-01-25 11:24:57 -0800177 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800178 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800179 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800180 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700181 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700182 "src/opts/**/*.cpp",
183 "src/opts/**/*.h",
184 "src/ports/**/*.cpp",
185 "src/ports/**/*.h",
186 ],
187 exclude = [
188 "src/opts/*mips*",
189 "src/opts/*SSE2*",
190 "src/opts/*SSSE3*",
191 "src/opts/*ssse3*",
192 "src/opts/*SSE4*",
193 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800194 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700195 "src/opts/*x86*",
196 "src/opts/SkBitmapProcState_opts_none.cpp",
197 "src/opts/SkBlitMask_opts_none.cpp",
198 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800199 "src/ports/*CG*",
mtklein3f193a92016-03-10 08:52:05 -0800200 "src/ports/*FontConfig*",
msarettfc0b6d12016-03-17 13:50:17 -0700201 "src/ports/*WIC*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700202 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700203 "src/ports/*fontconfig*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700204 "src/ports/*mac*",
205 "src/ports/*mozalloc*",
206 "src/ports/*nacl*",
207 "src/ports/*win*",
208 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800209 "src/ports/SkFontConfigInterface_direct_factory.cpp",
210 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700211 "src/ports/SkFontMgr_custom_directory_factory.cpp",
212 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700213 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700214 "src/ports/SkFontMgr_empty_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700215 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700216 "src/ports/SkImageGenerator_none.cpp",
217 "src/ports/SkTLS_none.cpp",
218 ],
219)
220
iroth8b99ef42015-11-02 11:11:21 -0800221# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800222BASE_SRCS_IOS = struct(
223 include = [
msarett2775cf52016-02-17 14:14:25 -0800224 "src/android/*",
225 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800226 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
227 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800228 "src/opts/**/*.cpp",
229 "src/opts/**/*.h",
230 "src/ports/**/*.cpp",
231 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800232 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800233 ],
234 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800235 "src/codec/*Gif*.cpp",
236 "src/codec/*Ico*.cpp",
237 "src/codec/*Jpeg*.cpp",
238 "src/codec/*Webp*.cpp",
239 "src/codec/*Png*",
240 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800241 "src/opts/*mips*",
242 "src/opts/*NEON*",
243 "src/opts/*neon*",
244 "src/opts/*SSE2*",
245 "src/opts/*SSSE3*",
246 "src/opts/*ssse3*",
247 "src/opts/*SSE4*",
248 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800249 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800250 "src/opts/*x86*",
251 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800252 "src/opts/SkBlitMask_opts_arm*.cpp",
253 "src/opts/SkBlitRow_opts_arm*.cpp",
mtklein3f193a92016-03-10 08:52:05 -0800254 "src/ports/*CG*",
255 "src/ports/*FontConfig*",
256 "src/ports/*FreeType*",
msarettfc0b6d12016-03-17 13:50:17 -0700257 "src/ports/*WIC*",
iroth8b99ef42015-11-02 11:11:21 -0800258 "src/ports/*android*",
259 "src/ports/*chromium*",
260 "src/ports/*fontconfig*",
iroth8b99ef42015-11-02 11:11:21 -0800261 "src/ports/*mozalloc*",
262 "src/ports/*nacl*",
263 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800264 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800265 "src/ports/SkFontConfigInterface_direct_factory.cpp",
266 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800267 "src/ports/SkFontMgr_custom_directory_factory.cpp",
268 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700269 "src/ports/SkFontMgr_custom_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800270 "src/ports/SkFontMgr_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800271 "src/ports/SkImageGenerator_none.cpp",
272 "src/ports/SkTLS_none.cpp",
273 ],
274)
275
benjaminwagner56f6d062016-01-13 10:45:19 -0800276################################################################################
277## SSSE3/SSE4/AVX/AVX2 SRCS
278################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700279
benjaminwagner56f6d062016-01-13 10:45:19 -0800280SSSE3_SRCS = struct(
281 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700282 "src/opts/*SSSE3*.cpp",
283 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800284 ],
285)
mtkleind55d13a2015-08-18 08:51:49 -0700286
benjaminwagner56f6d062016-01-13 10:45:19 -0800287SSE4_SRCS = struct(
288 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700289 "src/opts/*SSE4*.cpp",
290 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800291 ],
292)
benjaminwagner787ca872015-08-17 12:58:10 -0700293
benjaminwagner56f6d062016-01-13 10:45:19 -0800294AVX_SRCS = struct(
295 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800296 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800297 ],
298)
mtkleinf6d8d282015-12-17 10:18:04 -0800299
benjaminwagner56f6d062016-01-13 10:45:19 -0800300AVX2_SRCS = struct(
301 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800302 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800303 ],
304)
mtkleinf6d8d282015-12-17 10:18:04 -0800305
benjaminwagner56f6d062016-01-13 10:45:19 -0800306################################################################################
307## BASE_HDRS
308################################################################################
309
310BASE_HDRS = struct(
311 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700312 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800313 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700314 ],
mtkleind55d13a2015-08-18 08:51:49 -0700315 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700316 "include/private/**/*",
317
318 # Not used.
319 "include/animator/**/*",
320 "include/views/**/*",
321 "include/xml/SkBML_WXMLParser.h",
322 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800323 ],
324)
benjaminwagner787ca872015-08-17 12:58:10 -0700325
benjaminwagner56f6d062016-01-13 10:45:19 -0800326################################################################################
327## BASE_DEPS
328################################################################################
329
330BASE_DEPS_ALL = []
331
benjaminwagner39e7aa42015-11-18 13:26:10 -0800332BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800333 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800334 ":opts_sse4",
335 ":opts_avx",
336 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800337]
338
339BASE_DEPS_ANDROID = []
340
341BASE_DEPS_IOS = []
342
benjaminwagner56f6d062016-01-13 10:45:19 -0800343################################################################################
344## INCLUDES
345################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800346
benjaminwagner787ca872015-08-17 12:58:10 -0700347# Includes needed by Skia implementation. Not public includes.
348INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800349 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700350 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800351 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700352 "include/codec",
353 "include/config",
354 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700355 "include/effects",
356 "include/gpu",
357 "include/images",
358 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700359 "include/pipe",
360 "include/ports",
361 "include/private",
362 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800363 "include/utils/mac",
364 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700365 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700366 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800367 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700368 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700369 "src/gpu",
370 "src/image",
371 "src/lazy",
372 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800373 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700374 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700375 "src/sfnt",
376 "src/utils",
377 "third_party/etc1",
378 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800379]
benjaminwagner787ca872015-08-17 12:58:10 -0700380
benjaminwagner56f6d062016-01-13 10:45:19 -0800381################################################################################
382## DM_SRCS
383################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700384
benjaminwagner56f6d062016-01-13 10:45:19 -0800385DM_SRCS_ALL = struct(
386 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700387 "dm/*.cpp",
388 "dm/*.h",
389 "gm/*.c",
390 "gm/*.cpp",
391 "gm/*.h",
392 "tests/*.cpp",
393 "tests/*.h",
394 "tools/CrashHandler.cpp",
395 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700396 "tools/ProcStats.cpp",
397 "tools/ProcStats.h",
398 "tools/Resources.cpp",
399 "tools/Resources.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700400 "tools/flags/*.cpp",
401 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800402 "tools/random_parse_path.cpp",
403 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700404 "tools/sk_tool_utils.cpp",
405 "tools/sk_tool_utils.h",
406 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700407 "tools/timer/*.cpp",
408 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700409 ],
410 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700411 "dm/DMSrcSinkAndroid.cpp", # Android-only.
412 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
413 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700414 "tests/skia_test.cpp", # Old main.
415 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700416 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700417 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700418 ],
419)
420
benjaminwagner56f6d062016-01-13 10:45:19 -0800421DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700422
benjaminwagner56f6d062016-01-13 10:45:19 -0800423DM_SRCS_ANDROID = struct(
424 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700425 # Depends on Android HWUI library that is not available in google3.
426 #"dm/DMSrcSinkAndroid.cpp",
427 "tests/FontMgrAndroidParserTest.cpp",
428 ],
429)
430
benjaminwagner56f6d062016-01-13 10:45:19 -0800431DM_SRCS_IOS = struct()
432
433################################################################################
434## DM_INCLUDES
435################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700436
benjaminwagner6f6bef82015-10-15 08:09:44 -0700437DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800438 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700439 "gm",
440 "src/codec",
441 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800442 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700443 "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?
benjaminwagnerf6bfccd2016-02-25 10:28:11 -0800463 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText",
benjaminwagner56f6d062016-01-13 10:45:19 -0800464 "--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",
reede8f30622016-03-23 18:59:25 -0700518 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
reed7b380d02016-03-21 13:25:16 -0700519 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
reedb95f5552016-03-21 08:30:19 -0700520 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700521 # Turn on a few Google3-specific build fixes.
522 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700523 # Staging flags for API changes
524 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
525 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
fmalita41c40962016-03-24 11:05:28 -0700526 "SK_SUPPORT_LEGACY_PICTURE_PTR",
reedcfb6bdf2016-03-29 11:32:50 -0700527 "SK_SUPPORT_LEGACY_XFERMODE_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700528]
529
benjaminwagner56f6d062016-01-13 10:45:19 -0800530################################################################################
531## LINKOPTS
532################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700533
benjaminwagner56f6d062016-01-13 10:45:19 -0800534LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700535
benjaminwagner56f6d062016-01-13 10:45:19 -0800536LINKOPTS_ANDROID = [
537 "-lEGL",
538]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700539
benjaminwagner56f6d062016-01-13 10:45:19 -0800540LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700541
benjaminwagner56f6d062016-01-13 10:45:19 -0800542LINKOPTS_ALL = [
543 "-ldl",
544]