blob: 14a66a728c147bea8e2acb87c4788c28fe47a186 [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.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700104 "src/gpu/gl/mesa/*", # Requires SK_MESA define.
105 "src/svg/parser/*", # Missing SkSVG.h.
106
benjaminwagner39e7aa42015-11-18 13:26:10 -0800107 # Conflicting dependencies among Lua versions. See cl/107087297.
108 "src/utils/SkLua*",
109
benjaminwagner6f6bef82015-10-15 08:09:44 -0700110 # Not used.
111 "src/animator/**/*",
112 "src/views/**/*",
113 "src/xml/SkBML_Verbs.h",
114 "src/xml/SkBML_XMLParser.cpp",
115 "src/xml/SkXMLPullParser.cpp",
egdaniel32119f12016-02-22 10:07:54 -0800116
117 # Currently exclude all vulkan specific files
118 "src/gpu/vk/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700119 ],
120)
121
122# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800123BASE_SRCS_UNIX = struct(
124 include = [
irothd2ccc772016-01-25 11:24:57 -0800125 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800126 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800127 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth5f0de062016-02-17 12:47:27 -0800128 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800129 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700130 "src/opts/**/*.cpp",
131 "src/opts/**/*.h",
132 "src/ports/**/*.cpp",
133 "src/ports/**/*.h",
134 ],
135 exclude = [
136 "src/opts/*arm*",
137 "src/opts/*mips*",
138 "src/opts/*NEON*",
139 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700140 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700141 "src/opts/*SSSE3*",
142 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700143 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700144 "src/opts/*SSE4*",
145 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800146 # Included in :opts_avx or :opts_avx2
147 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700148 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700149 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700150 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800151 "src/ports/*CG*",
msarettfc0b6d12016-03-17 13:50:17 -0700152 "src/ports/*WIC*",
mtklein3f193a92016-03-10 08:52:05 -0800153 "src/ports/*android*",
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",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700162 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700163 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800164 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800165 "src/ports/SkFontMgr_fontconfig_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700166 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700167 "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",
msarett6b4985c2016-03-10 07:15:59 -0800197 "src/ports/*CG*",
mtklein3f193a92016-03-10 08:52:05 -0800198 "src/ports/*FontConfig*",
msarettfc0b6d12016-03-17 13:50:17 -0700199 "src/ports/*WIC*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700200 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700201 "src/ports/*fontconfig*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700202 "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",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700211 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700212 "src/ports/SkFontMgr_empty_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700213 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700214 "src/ports/SkImageGenerator_none.cpp",
215 "src/ports/SkTLS_none.cpp",
216 ],
217)
218
iroth8b99ef42015-11-02 11:11:21 -0800219# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800220BASE_SRCS_IOS = struct(
221 include = [
msarett2775cf52016-02-17 14:14:25 -0800222 "src/android/*",
223 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800224 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
225 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800226 "src/opts/**/*.cpp",
227 "src/opts/**/*.h",
228 "src/ports/**/*.cpp",
229 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800230 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800231 ],
232 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800233 "src/codec/*Gif*.cpp",
234 "src/codec/*Ico*.cpp",
235 "src/codec/*Jpeg*.cpp",
236 "src/codec/*Webp*.cpp",
237 "src/codec/*Png*",
238 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800239 "src/opts/*mips*",
240 "src/opts/*NEON*",
241 "src/opts/*neon*",
242 "src/opts/*SSE2*",
243 "src/opts/*SSSE3*",
244 "src/opts/*ssse3*",
245 "src/opts/*SSE4*",
246 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800247 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800248 "src/opts/*x86*",
249 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800250 "src/opts/SkBlitMask_opts_arm*.cpp",
251 "src/opts/SkBlitRow_opts_arm*.cpp",
mtklein3f193a92016-03-10 08:52:05 -0800252 "src/ports/*CG*",
253 "src/ports/*FontConfig*",
254 "src/ports/*FreeType*",
msarettfc0b6d12016-03-17 13:50:17 -0700255 "src/ports/*WIC*",
iroth8b99ef42015-11-02 11:11:21 -0800256 "src/ports/*android*",
257 "src/ports/*chromium*",
258 "src/ports/*fontconfig*",
iroth8b99ef42015-11-02 11:11:21 -0800259 "src/ports/*mozalloc*",
260 "src/ports/*nacl*",
261 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800262 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800263 "src/ports/SkFontConfigInterface_direct_factory.cpp",
264 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800265 "src/ports/SkFontMgr_custom_directory_factory.cpp",
266 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700267 "src/ports/SkFontMgr_custom_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800268 "src/ports/SkFontMgr_empty_factory.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",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700398 "tools/flags/*.cpp",
399 "tools/flags/*.h",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700400 "tools/gpu/**/*.cpp",
401 "tools/gpu/**/*.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.
benjaminwagner38d68bc2016-04-01 05:00:51 -0700416 "tools/gpu/gl/angle/*",
417 "tools/gpu/gl/command_buffer/*",
418 "tools/gpu/gl/egl/*",
419 "tools/gpu/gl/glx/*",
420 "tools/gpu/gl/iOS/*",
421 "tools/gpu/gl/mac/*",
422 "tools/gpu/gl/mesa/*",
423 "tools/gpu/gl/win/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700424 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700425 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700426 ],
427)
428
benjaminwagner38d68bc2016-04-01 05:00:51 -0700429DM_SRCS_UNIX = struct(
430 include = [
431 "tools/gpu/gl/CreatePlatformGLContext_none.cpp",
432 ],
433)
benjaminwagner86ea33e2015-10-26 10:46:25 -0700434
benjaminwagner56f6d062016-01-13 10:45:19 -0800435DM_SRCS_ANDROID = struct(
436 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700437 # Depends on Android HWUI library that is not available in google3.
438 #"dm/DMSrcSinkAndroid.cpp",
439 "tests/FontMgrAndroidParserTest.cpp",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700440 # TODO(benjaminwagner): Figure out how to compile with EGL.
441 "tools/gpu/gl/CreatePlatformGLContext_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700442 ],
443)
444
benjaminwagner38d68bc2016-04-01 05:00:51 -0700445DM_SRCS_IOS = struct(
446 include = [
447 "tools/gpu/iOS/CreatePlatformGLContext_iOS.cpp",
448 ],
449)
benjaminwagner56f6d062016-01-13 10:45:19 -0800450
451################################################################################
452## DM_INCLUDES
453################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700454
benjaminwagner6f6bef82015-10-15 08:09:44 -0700455DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800456 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700457 "gm",
458 "src/codec",
459 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800460 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700461 "src/fonts",
462 "src/pathops",
463 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700464 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800465 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700466 "tests",
467 "tools",
468 "tools/flags",
benjaminwagner38d68bc2016-04-01 05:00:51 -0700469 "tools/gpu",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700470 "tools/timer",
471]
472
benjaminwagner56f6d062016-01-13 10:45:19 -0800473################################################################################
474## DM_ARGS
475################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700476
benjaminwagner56f6d062016-01-13 10:45:19 -0800477def DM_ARGS(base_dir):
478 return [
479 "--nogpu",
480 "--verbose",
481 # TODO(mtklein): maybe investigate why these fail?
benjaminwagnerf6bfccd2016-02-25 10:28:11 -0800482 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText",
benjaminwagner56f6d062016-01-13 10:45:19 -0800483 "--resourcePath %s/resources" % base_dir,
484 "--images %s/resources" % base_dir,
485 ]
486
487################################################################################
488## COPTS
489################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800490
benjaminwagner86ea33e2015-10-26 10:46:25 -0700491COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700492 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700493 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700494]
495
benjaminwagner56f6d062016-01-13 10:45:19 -0800496COPTS_ANDROID = ["-mfpu=neon"]
497
498COPTS_IOS = []
499
500COPTS_ALL = []
501
502################################################################################
503## DEFINES
504################################################################################
505
506DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800507 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800508 "SK_BUILD_FOR_UNIX",
509 "SK_SAMPLES_FOR_X",
510 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800511 "SK_CODEC_DECODES_GIF",
512 "SK_CODEC_DECODES_JPEG",
513 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800514 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800515 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800516]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700517
518DEFINES_ANDROID = [
519 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800520 "SK_CODEC_DECODES_GIF",
521 "SK_CODEC_DECODES_JPEG",
522 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800523 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800524 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700525]
526
iroth8b99ef42015-11-02 11:11:21 -0800527DEFINES_IOS = [
528 "SK_BUILD_FOR_IOS",
529 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800530 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800531]
532
benjaminwagner86ea33e2015-10-26 10:46:25 -0700533DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700534 # Chrome DEFINES.
535 "SK_USE_FLOATBITS",
536 "SK_USE_FREETYPE_EMBOLDEN",
reede8f30622016-03-23 18:59:25 -0700537 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
reed7b380d02016-03-21 13:25:16 -0700538 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
reedb95f5552016-03-21 08:30:19 -0700539 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700540 # Turn on a few Google3-specific build fixes.
541 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700542 # Staging flags for API changes
543 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
544 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
fmalita41c40962016-03-24 11:05:28 -0700545 "SK_SUPPORT_LEGACY_PICTURE_PTR",
reedcfb6bdf2016-03-29 11:32:50 -0700546 "SK_SUPPORT_LEGACY_XFERMODE_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700547]
548
benjaminwagner56f6d062016-01-13 10:45:19 -0800549################################################################################
550## LINKOPTS
551################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700552
benjaminwagner56f6d062016-01-13 10:45:19 -0800553LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700554
benjaminwagner56f6d062016-01-13 10:45:19 -0800555LINKOPTS_ANDROID = [
556 "-lEGL",
557]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700558
benjaminwagner56f6d062016-01-13 10:45:19 -0800559LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700560
benjaminwagner56f6d062016-01-13 10:45:19 -0800561LINKOPTS_ALL = [
562 "-ldl",
563]