blob: 758cb2e62bb99369a674ca3b92b86c9cae867fca [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",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700168 "src/ports/SkImageDecoder_empty.cpp",
msarettc1d03122016-03-25 08:58:55 -0700169 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700170 "src/ports/SkImageGenerator_none.cpp",
171 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700172 ],
173)
174
benjaminwagner86ea33e2015-10-26 10:46:25 -0700175# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800176BASE_SRCS_ANDROID = struct(
177 include = [
irothd2ccc772016-01-25 11:24:57 -0800178 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800179 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800180 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
iroth76a12252016-01-07 07:11:39 -0800181 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700182 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700183 "src/opts/**/*.cpp",
184 "src/opts/**/*.h",
185 "src/ports/**/*.cpp",
186 "src/ports/**/*.h",
187 ],
188 exclude = [
189 "src/opts/*mips*",
190 "src/opts/*SSE2*",
191 "src/opts/*SSSE3*",
192 "src/opts/*ssse3*",
193 "src/opts/*SSE4*",
194 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800195 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700196 "src/opts/*x86*",
197 "src/opts/SkBitmapProcState_opts_none.cpp",
198 "src/opts/SkBlitMask_opts_none.cpp",
199 "src/opts/SkBlitRow_opts_none.cpp",
msarett6b4985c2016-03-10 07:15:59 -0800200 "src/ports/*CG*",
mtklein3f193a92016-03-10 08:52:05 -0800201 "src/ports/*FontConfig*",
msarettfc0b6d12016-03-17 13:50:17 -0700202 "src/ports/*WIC*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700203 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700204 "src/ports/*fontconfig*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700205 "src/ports/*mac*",
206 "src/ports/*mozalloc*",
207 "src/ports/*nacl*",
208 "src/ports/*win*",
209 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800210 "src/ports/SkFontConfigInterface_direct_factory.cpp",
211 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700212 "src/ports/SkFontMgr_custom_directory_factory.cpp",
213 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700214 "src/ports/SkFontMgr_custom_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700215 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700216 "src/ports/SkImageDecoder_empty.cpp",
msarettc1d03122016-03-25 08:58:55 -0700217 "src/ports/SkImageEncoder_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700218 "src/ports/SkImageGenerator_none.cpp",
219 "src/ports/SkTLS_none.cpp",
220 ],
221)
222
iroth8b99ef42015-11-02 11:11:21 -0800223# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800224BASE_SRCS_IOS = struct(
225 include = [
msarett2775cf52016-02-17 14:14:25 -0800226 "src/android/*",
227 "src/codec/*",
iroth5f0de062016-02-17 12:47:27 -0800228 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
229 "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800230 "src/opts/**/*.cpp",
231 "src/opts/**/*.h",
232 "src/ports/**/*.cpp",
233 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800234 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800235 ],
236 exclude = [
msarett2775cf52016-02-17 14:14:25 -0800237 "src/codec/*Gif*.cpp",
238 "src/codec/*Ico*.cpp",
239 "src/codec/*Jpeg*.cpp",
240 "src/codec/*Webp*.cpp",
241 "src/codec/*Png*",
242 "src/codec/*Raw*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800243 "src/opts/*mips*",
244 "src/opts/*NEON*",
245 "src/opts/*neon*",
246 "src/opts/*SSE2*",
247 "src/opts/*SSSE3*",
248 "src/opts/*ssse3*",
249 "src/opts/*SSE4*",
250 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800251 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800252 "src/opts/*x86*",
253 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800254 "src/opts/SkBlitMask_opts_arm*.cpp",
255 "src/opts/SkBlitRow_opts_arm*.cpp",
mtklein3f193a92016-03-10 08:52:05 -0800256 "src/ports/*CG*",
257 "src/ports/*FontConfig*",
258 "src/ports/*FreeType*",
msarettfc0b6d12016-03-17 13:50:17 -0700259 "src/ports/*WIC*",
iroth8b99ef42015-11-02 11:11:21 -0800260 "src/ports/*android*",
261 "src/ports/*chromium*",
262 "src/ports/*fontconfig*",
iroth8b99ef42015-11-02 11:11:21 -0800263 "src/ports/*mozalloc*",
264 "src/ports/*nacl*",
265 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800266 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800267 "src/ports/SkFontConfigInterface_direct_factory.cpp",
268 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800269 "src/ports/SkFontMgr_custom_directory_factory.cpp",
270 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
benjaminwagnerd9dd5812016-03-21 10:45:01 -0700271 "src/ports/SkFontMgr_custom_empty_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800272 "src/ports/SkFontMgr_empty_factory.cpp",
msarettc1d03122016-03-25 08:58:55 -0700273 "src/ports/SkImageDecoder_empty.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800274 "src/ports/SkImageGenerator_none.cpp",
275 "src/ports/SkTLS_none.cpp",
276 ],
277)
278
benjaminwagner56f6d062016-01-13 10:45:19 -0800279################################################################################
280## SSSE3/SSE4/AVX/AVX2 SRCS
281################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700282
benjaminwagner56f6d062016-01-13 10:45:19 -0800283SSSE3_SRCS = struct(
284 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700285 "src/opts/*SSSE3*.cpp",
286 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800287 ],
288)
mtkleind55d13a2015-08-18 08:51:49 -0700289
benjaminwagner56f6d062016-01-13 10:45:19 -0800290SSE4_SRCS = struct(
291 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700292 "src/opts/*SSE4*.cpp",
293 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800294 ],
295)
benjaminwagner787ca872015-08-17 12:58:10 -0700296
benjaminwagner56f6d062016-01-13 10:45:19 -0800297AVX_SRCS = struct(
298 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800299 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800300 ],
301)
mtkleinf6d8d282015-12-17 10:18:04 -0800302
benjaminwagner56f6d062016-01-13 10:45:19 -0800303AVX2_SRCS = struct(
304 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800305 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800306 ],
307)
mtkleinf6d8d282015-12-17 10:18:04 -0800308
benjaminwagner56f6d062016-01-13 10:45:19 -0800309################################################################################
310## BASE_HDRS
311################################################################################
312
313BASE_HDRS = struct(
314 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700315 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800316 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700317 ],
mtkleind55d13a2015-08-18 08:51:49 -0700318 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700319 "include/private/**/*",
320
321 # Not used.
322 "include/animator/**/*",
323 "include/views/**/*",
324 "include/xml/SkBML_WXMLParser.h",
325 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800326 ],
327)
benjaminwagner787ca872015-08-17 12:58:10 -0700328
benjaminwagner56f6d062016-01-13 10:45:19 -0800329################################################################################
330## BASE_DEPS
331################################################################################
332
333BASE_DEPS_ALL = []
334
benjaminwagner39e7aa42015-11-18 13:26:10 -0800335BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800336 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800337 ":opts_sse4",
338 ":opts_avx",
339 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800340]
341
342BASE_DEPS_ANDROID = []
343
344BASE_DEPS_IOS = []
345
benjaminwagner56f6d062016-01-13 10:45:19 -0800346################################################################################
347## INCLUDES
348################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800349
benjaminwagner787ca872015-08-17 12:58:10 -0700350# Includes needed by Skia implementation. Not public includes.
351INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800352 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700353 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800354 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700355 "include/codec",
356 "include/config",
357 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700358 "include/effects",
359 "include/gpu",
360 "include/images",
361 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700362 "include/pipe",
363 "include/ports",
364 "include/private",
365 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800366 "include/utils/mac",
367 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700368 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700369 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800370 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700371 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700372 "src/gpu",
373 "src/image",
374 "src/lazy",
375 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800376 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700377 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700378 "src/sfnt",
379 "src/utils",
380 "third_party/etc1",
381 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800382]
benjaminwagner787ca872015-08-17 12:58:10 -0700383
benjaminwagner56f6d062016-01-13 10:45:19 -0800384################################################################################
385## DM_SRCS
386################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700387
benjaminwagner56f6d062016-01-13 10:45:19 -0800388DM_SRCS_ALL = struct(
389 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700390 "dm/*.cpp",
391 "dm/*.h",
392 "gm/*.c",
393 "gm/*.cpp",
394 "gm/*.h",
395 "tests/*.cpp",
396 "tests/*.h",
397 "tools/CrashHandler.cpp",
398 "tools/CrashHandler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700399 "tools/ProcStats.cpp",
400 "tools/ProcStats.h",
401 "tools/Resources.cpp",
402 "tools/Resources.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700403 "tools/flags/*.cpp",
404 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800405 "tools/random_parse_path.cpp",
406 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700407 "tools/sk_tool_utils.cpp",
408 "tools/sk_tool_utils.h",
409 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700410 "tools/timer/*.cpp",
411 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700412 ],
413 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700414 "dm/DMSrcSinkAndroid.cpp", # Android-only.
415 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
416 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700417 "tests/skia_test.cpp", # Old main.
418 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700419 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700420 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700421 ],
422)
423
benjaminwagner56f6d062016-01-13 10:45:19 -0800424DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700425
benjaminwagner56f6d062016-01-13 10:45:19 -0800426DM_SRCS_ANDROID = struct(
427 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700428 # Depends on Android HWUI library that is not available in google3.
429 #"dm/DMSrcSinkAndroid.cpp",
430 "tests/FontMgrAndroidParserTest.cpp",
431 ],
432)
433
benjaminwagner56f6d062016-01-13 10:45:19 -0800434DM_SRCS_IOS = struct()
435
436################################################################################
437## DM_INCLUDES
438################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700439
benjaminwagner6f6bef82015-10-15 08:09:44 -0700440DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800441 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700442 "gm",
443 "src/codec",
444 "src/effects",
benjaminwagnerbc9a9b42016-02-22 13:30:39 -0800445 "src/effects/gradients",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700446 "src/fonts",
447 "src/pathops",
448 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700449 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800450 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700451 "tests",
452 "tools",
453 "tools/flags",
454 "tools/timer",
455]
456
benjaminwagner56f6d062016-01-13 10:45:19 -0800457################################################################################
458## DM_ARGS
459################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700460
benjaminwagner56f6d062016-01-13 10:45:19 -0800461def DM_ARGS(base_dir):
462 return [
463 "--nogpu",
464 "--verbose",
465 # TODO(mtklein): maybe investigate why these fail?
benjaminwagnerf6bfccd2016-02-25 10:28:11 -0800466 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText",
benjaminwagner56f6d062016-01-13 10:45:19 -0800467 "--resourcePath %s/resources" % base_dir,
468 "--images %s/resources" % base_dir,
469 ]
470
471################################################################################
472## COPTS
473################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800474
benjaminwagner86ea33e2015-10-26 10:46:25 -0700475COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700476 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700477 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700478]
479
benjaminwagner56f6d062016-01-13 10:45:19 -0800480COPTS_ANDROID = ["-mfpu=neon"]
481
482COPTS_IOS = []
483
484COPTS_ALL = []
485
486################################################################################
487## DEFINES
488################################################################################
489
490DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800491 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800492 "SK_BUILD_FOR_UNIX",
493 "SK_SAMPLES_FOR_X",
494 "SK_SFNTLY_SUBSETTER",
msarett39b2d5a2016-02-17 08:26:31 -0800495 "SK_CODEC_DECODES_GIF",
496 "SK_CODEC_DECODES_JPEG",
497 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800498 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800499 "SK_CODEC_DECODES_WEBP",
benjaminwagner56f6d062016-01-13 10:45:19 -0800500]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700501
502DEFINES_ANDROID = [
503 "SK_BUILD_FOR_ANDROID",
msarett39b2d5a2016-02-17 08:26:31 -0800504 "SK_CODEC_DECODES_GIF",
505 "SK_CODEC_DECODES_JPEG",
506 "SK_CODEC_DECODES_PNG",
benjaminwagner186e0b92016-02-11 16:00:24 -0800507 "SK_CODEC_DECODES_RAW",
msarett39b2d5a2016-02-17 08:26:31 -0800508 "SK_CODEC_DECODES_WEBP",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700509]
510
iroth8b99ef42015-11-02 11:11:21 -0800511DEFINES_IOS = [
512 "SK_BUILD_FOR_IOS",
513 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800514 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800515]
516
benjaminwagner86ea33e2015-10-26 10:46:25 -0700517DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700518 # Chrome DEFINES.
519 "SK_USE_FLOATBITS",
520 "SK_USE_FREETYPE_EMBOLDEN",
reede8f30622016-03-23 18:59:25 -0700521 "SK_SUPPORT_LEGACY_NEW_SURFACE_API",
reed7b380d02016-03-21 13:25:16 -0700522 "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR",
reedb95f5552016-03-21 08:30:19 -0700523 "SK_SUPPORT_LEGACY_PATHEFFECT_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700524 # Turn on a few Google3-specific build fixes.
525 "GOOGLE3",
reedd053ce92016-03-22 10:17:23 -0700526 # Staging flags for API changes
527 "SK_SUPPORT_LEGACY_COLORFILTER_PTR",
528 "SK_SUPPORT_LEGACY_CREATESHADER_PTR",
fmalita41c40962016-03-24 11:05:28 -0700529 "SK_SUPPORT_LEGACY_PICTURE_PTR",
benjaminwagner787ca872015-08-17 12:58:10 -0700530]
531
benjaminwagner56f6d062016-01-13 10:45:19 -0800532################################################################################
533## LINKOPTS
534################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700535
benjaminwagner56f6d062016-01-13 10:45:19 -0800536LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700537
benjaminwagner56f6d062016-01-13 10:45:19 -0800538LINKOPTS_ANDROID = [
539 "-lEGL",
540]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700541
benjaminwagner56f6d062016-01-13 10:45:19 -0800542LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700543
benjaminwagner56f6d062016-01-13 10:45:19 -0800544LINKOPTS_ALL = [
545 "-ldl",
546]