blob: 349d99125f781f42bad083f1f3073b3523d1e141 [file] [log] [blame]
benjaminwagner56f6d062016-01-13 10:45:19 -08001################################################################################
2# Skylark macros
3################################################################################
benjaminwagner787ca872015-08-17 12:58:10 -07004
benjaminwagner56f6d062016-01-13 10:45:19 -08005is_bazel = not hasattr(native, "genmpm")
6
7def portable_select(select_dict, bazel_condition, default_condition):
8 """Replaces select() with a Bazel-friendly wrapper.
9
10 Args:
11 select_dict: Dictionary in the same format as select().
12 Returns:
13 If Blaze platform, returns select() using select_dict.
14 If Bazel platform, returns dependencies for condition
15 bazel_condition, or empty list if none specified.
16 """
17 if is_bazel:
18 return select_dict.get(bazel_condition, select_dict[default_condition])
19 else:
20 return select(select_dict)
21
22def skia_select(conditions, results):
23 """Replaces select() for conditions [UNIX, ANDROID, IOS]
24
25 Args:
26 conditions: [CONDITION_UNIX, CONDITION_ANDROID, CONDITION_IOS]
27 results: [RESULT_UNIX, RESULT_ANDROID, RESULT_IOS]
28 Returns:
29 The result matching the platform condition.
30 """
31 if len(conditions) != 3 or len(results) != 3:
32 fail("Must provide exactly 3 conditions and 3 results")
33
34 selector = {}
35 for i in range(3):
36 selector[conditions[i]] = results[i]
37 return portable_select(selector, conditions[2], conditions[0])
38
39def skia_glob(srcs):
40 """Replaces glob() with a version that accepts a struct.
41
42 Args:
43 srcs: struct(include=[], exclude=[])
44 Returns:
45 Equivalent of glob(srcs.include, exclude=srcs.exclude)
46 """
47 if hasattr(srcs, 'include'):
48 if hasattr(srcs, 'exclude'):
49 return native.glob(srcs.include, exclude=srcs.exclude)
50 else:
51 return native.glob(srcs.include)
52 return []
53
54################################################################################
55## BASE_SRCS
56################################################################################
benjaminwagner787ca872015-08-17 12:58:10 -070057
benjaminwagner39e7aa42015-11-18 13:26:10 -080058# All platform-independent SRCS.
benjaminwagner56f6d062016-01-13 10:45:19 -080059BASE_SRCS_ALL = struct(
60 include = [
mtkleind55d13a2015-08-18 08:51:49 -070061 "include/private/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -070062 "src/**/*.h",
63 "src/**/*.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -070064
mtkleind55d13a2015-08-18 08:51:49 -070065 # Third Party
benjaminwagner787ca872015-08-17 12:58:10 -070066 "third_party/etc1/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070067 "third_party/etc1/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070068 "third_party/ktx/*.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070069 "third_party/ktx/*.h",
benjaminwagner787ca872015-08-17 12:58:10 -070070 ],
71 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -070072 # Exclude platform-dependent files.
irothd2ccc772016-01-25 11:24:57 -080073 "src/android/*",
iroth76a12252016-01-07 07:11:39 -080074 "src/codec/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070075 "src/device/xps/*", # Windows-only. Move to ports?
76 "src/doc/*_XPS.cpp", # Windows-only. Move to ports?
benjaminwagner2211a7b2015-12-01 11:12:05 -080077 "src/fonts/SkFontMgr_fontconfig.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070078 "src/gpu/gl/android/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -070079 "src/gpu/gl/egl/*",
80 "src/gpu/gl/glx/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070081 "src/gpu/gl/iOS/*",
82 "src/gpu/gl/mac/*",
83 "src/gpu/gl/win/*",
iroth76a12252016-01-07 07:11:39 -080084 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070085 "src/opts/**/*",
86 "src/ports/**/*",
87 "src/utils/android/**/*",
88 "src/utils/mac/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070089 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
90 "src/utils/win/**/*",
91 "src/views/sdl/*",
92 "src/views/win/*",
93 "src/views/unix/*",
94
95 # Exclude multiple definitions.
96 # TODO(mtklein): Move to opts?
mtkleind55d13a2015-08-18 08:51:49 -070097 "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp.
benjaminwagner86ea33e2015-10-26 10:46:25 -070098 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
99 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700100
101 # Exclude files that don't compile with the current DEFINES.
102 "src/gpu/gl/angle/*", # Requires SK_ANGLE define.
103 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE'
104 "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",
116 ],
117)
118
119# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800120BASE_SRCS_UNIX = struct(
121 include = [
irothd2ccc772016-01-25 11:24:57 -0800122 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800123 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800124 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth76a12252016-01-07 07:11:39 -0800125 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700126 "src/opts/**/*.cpp",
127 "src/opts/**/*.h",
128 "src/ports/**/*.cpp",
129 "src/ports/**/*.h",
130 ],
131 exclude = [
iroth76a12252016-01-07 07:11:39 -0800132 "src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch.
benjaminwagner89061ed2016-01-25 09:29:08 -0800133 # TODO(benjaminwagner): Can this be enabled?
134 "src/codec/SkRaw*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700135 "src/opts/*arm*",
136 "src/opts/*mips*",
137 "src/opts/*NEON*",
138 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700139 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700140 "src/opts/*SSSE3*",
141 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700142 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700143 "src/opts/*SSE4*",
144 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800145 # Included in :opts_avx or :opts_avx2
146 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700147 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700148 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700149 "src/opts/SkBlitRow_opts_none.cpp",
150 "src/ports/*android*",
151 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700152 "src/ports/*mac*",
153 "src/ports/*mozalloc*",
154 "src/ports/*nacl*",
155 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800156 "src/ports/SkFontConfigInterface_direct_factory.cpp",
157 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700158 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
159 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800160 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800161 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800162 "src/ports/SkFontMgr_fontconfig_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700163 "src/ports/SkImageDecoder_WIC.cpp",
164 "src/ports/SkImageDecoder_empty.cpp",
165 "src/ports/SkImageGenerator_none.cpp",
166 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700167 ],
168)
169
benjaminwagner86ea33e2015-10-26 10:46:25 -0700170# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800171BASE_SRCS_ANDROID = struct(
172 include = [
irothd2ccc772016-01-25 11:24:57 -0800173 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800174 "src/codec/*",
175 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700176 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700177 "src/opts/**/*.cpp",
178 "src/opts/**/*.h",
179 "src/ports/**/*.cpp",
180 "src/ports/**/*.h",
181 ],
182 exclude = [
iroth76a12252016-01-07 07:11:39 -0800183 "src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch.
benjaminwagner89061ed2016-01-25 09:29:08 -0800184 # TODO(benjaminwagner): Can this be enabled?
185 "src/codec/SkRaw*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700186 "src/opts/*mips*",
187 "src/opts/*SSE2*",
188 "src/opts/*SSSE3*",
189 "src/opts/*ssse3*",
190 "src/opts/*SSE4*",
191 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800192 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700193 "src/opts/*x86*",
194 "src/opts/SkBitmapProcState_opts_none.cpp",
195 "src/opts/SkBlitMask_opts_none.cpp",
196 "src/opts/SkBlitRow_opts_none.cpp",
197 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700198 "src/ports/*fontconfig*",
199 "src/ports/*FontConfig*",
200 "src/ports/*mac*",
201 "src/ports/*mozalloc*",
202 "src/ports/*nacl*",
203 "src/ports/*win*",
204 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800205 "src/ports/SkFontConfigInterface_direct_factory.cpp",
206 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700207 "src/ports/SkFontMgr_custom_directory_factory.cpp",
208 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
209 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800210 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700211 "src/ports/SkImageDecoder_WIC.cpp",
212 "src/ports/SkImageDecoder_empty.cpp",
213 "src/ports/SkImageGenerator_none.cpp",
214 "src/ports/SkTLS_none.cpp",
215 ],
216)
217
iroth8b99ef42015-11-02 11:11:21 -0800218# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800219BASE_SRCS_IOS = struct(
220 include = [
iroth8b99ef42015-11-02 11:11:21 -0800221 "src/opts/**/*.cpp",
222 "src/opts/**/*.h",
223 "src/ports/**/*.cpp",
224 "src/ports/**/*.h",
225 ],
226 exclude = [
227 "src/opts/*mips*",
228 "src/opts/*NEON*",
229 "src/opts/*neon*",
230 "src/opts/*SSE2*",
231 "src/opts/*SSSE3*",
232 "src/opts/*ssse3*",
233 "src/opts/*SSE4*",
234 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800235 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800236 "src/opts/*x86*",
237 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800238 "src/opts/SkBlitMask_opts_arm*.cpp",
239 "src/opts/SkBlitRow_opts_arm*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800240 "src/ports/*android*",
241 "src/ports/*chromium*",
242 "src/ports/*fontconfig*",
243 "src/ports/*FontConfig*",
244 "src/ports/*FreeType*",
245 "src/ports/*mozalloc*",
246 "src/ports/*nacl*",
247 "src/ports/*win*",
248 "src/ports/SkDebug_stdio.cpp",
249 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800250 "src/ports/SkFontConfigInterface_direct_factory.cpp",
251 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800252 "src/ports/SkFontMgr_custom_directory_factory.cpp",
253 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
254 "src/ports/SkFontMgr_empty_factory.cpp",
255 "src/ports/SkImageDecoder_CG.cpp",
256 "src/ports/SkImageDecoder_WIC.cpp",
257 "src/ports/SkImageDecoder_empty.cpp",
258 "src/ports/SkImageGenerator_none.cpp",
259 "src/ports/SkTLS_none.cpp",
260 ],
261)
262
benjaminwagner56f6d062016-01-13 10:45:19 -0800263################################################################################
264## SSSE3/SSE4/AVX/AVX2 SRCS
265################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700266
benjaminwagner56f6d062016-01-13 10:45:19 -0800267SSSE3_SRCS = struct(
268 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700269 "src/opts/*SSSE3*.cpp",
270 "src/opts/*ssse3*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800271 ],
272)
mtkleind55d13a2015-08-18 08:51:49 -0700273
benjaminwagner56f6d062016-01-13 10:45:19 -0800274SSE4_SRCS = struct(
275 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700276 "src/opts/*SSE4*.cpp",
277 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800278 ],
279)
benjaminwagner787ca872015-08-17 12:58:10 -0700280
benjaminwagner56f6d062016-01-13 10:45:19 -0800281AVX_SRCS = struct(
282 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800283 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800284 ],
285)
mtkleinf6d8d282015-12-17 10:18:04 -0800286
benjaminwagner56f6d062016-01-13 10:45:19 -0800287AVX2_SRCS = struct(
288 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800289 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800290 ],
291)
mtkleinf6d8d282015-12-17 10:18:04 -0800292
benjaminwagner56f6d062016-01-13 10:45:19 -0800293################################################################################
294## BASE_HDRS
295################################################################################
296
297BASE_HDRS = struct(
298 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700299 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800300 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700301 ],
mtkleind55d13a2015-08-18 08:51:49 -0700302 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700303 "include/private/**/*",
304
305 # Not used.
306 "include/animator/**/*",
307 "include/views/**/*",
308 "include/xml/SkBML_WXMLParser.h",
309 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800310 ],
311)
benjaminwagner787ca872015-08-17 12:58:10 -0700312
benjaminwagner56f6d062016-01-13 10:45:19 -0800313################################################################################
314## BASE_DEPS
315################################################################################
316
317BASE_DEPS_ALL = []
318
benjaminwagner39e7aa42015-11-18 13:26:10 -0800319BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800320 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800321 ":opts_sse4",
322 ":opts_avx",
323 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800324]
325
326BASE_DEPS_ANDROID = []
327
328BASE_DEPS_IOS = []
329
benjaminwagner56f6d062016-01-13 10:45:19 -0800330################################################################################
331## INCLUDES
332################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800333
benjaminwagner787ca872015-08-17 12:58:10 -0700334# Includes needed by Skia implementation. Not public includes.
335INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800336 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700337 "include/c",
338 "include/codec",
339 "include/config",
340 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700341 "include/effects",
342 "include/gpu",
343 "include/images",
344 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700345 "include/pipe",
346 "include/ports",
347 "include/private",
348 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800349 "include/utils/mac",
350 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700351 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700352 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800353 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700354 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700355 "src/gpu",
356 "src/image",
357 "src/lazy",
358 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800359 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700360 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700361 "src/sfnt",
362 "src/utils",
363 "third_party/etc1",
364 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800365]
benjaminwagner787ca872015-08-17 12:58:10 -0700366
benjaminwagner56f6d062016-01-13 10:45:19 -0800367################################################################################
368## DM_SRCS
369################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700370
benjaminwagner56f6d062016-01-13 10:45:19 -0800371DM_SRCS_ALL = struct(
372 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700373 "dm/*.cpp",
374 "dm/*.h",
375 "gm/*.c",
376 "gm/*.cpp",
377 "gm/*.h",
378 "tests/*.cpp",
379 "tests/*.h",
380 "tools/CrashHandler.cpp",
381 "tools/CrashHandler.h",
382 "tools/LazyDecodeBitmap.cpp",
383 "tools/LazyDecodeBitmap.h",
384 "tools/ProcStats.cpp",
385 "tools/ProcStats.h",
386 "tools/Resources.cpp",
387 "tools/Resources.h",
benjaminwagner32885142015-10-24 07:55:31 -0700388 "tools/SkBitmapRegionCanvas.cpp",
389 "tools/SkBitmapRegionCanvas.h",
390 "tools/SkBitmapRegionCodec.cpp",
391 "tools/SkBitmapRegionCodec.h",
msarett5cb48852015-11-06 08:56:32 -0800392 "tools/SkBitmapRegionDecoder.cpp",
393 "tools/SkBitmapRegionDecoder.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700394 "tools/SkBitmapRegionSampler.cpp",
395 "tools/SkBitmapRegionSampler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700396 "tools/flags/*.cpp",
397 "tools/flags/*.h",
benjaminwagner32885142015-10-24 07:55:31 -0700398 "tools/sk_tool_utils.cpp",
399 "tools/sk_tool_utils.h",
400 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700401 "tools/timer/*.cpp",
402 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700403 ],
404 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700405 "dm/DMSrcSinkAndroid.cpp", # Android-only.
406 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
407 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700408 "tests/skia_test.cpp", # Old main.
409 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700410 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700411 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700412 ],
413)
414
benjaminwagner56f6d062016-01-13 10:45:19 -0800415DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700416
benjaminwagner56f6d062016-01-13 10:45:19 -0800417DM_SRCS_ANDROID = struct(
418 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700419 # Depends on Android HWUI library that is not available in google3.
420 #"dm/DMSrcSinkAndroid.cpp",
421 "tests/FontMgrAndroidParserTest.cpp",
422 ],
423)
424
benjaminwagner56f6d062016-01-13 10:45:19 -0800425DM_SRCS_IOS = struct()
426
427################################################################################
428## DM_INCLUDES
429################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700430
benjaminwagner6f6bef82015-10-15 08:09:44 -0700431DM_INCLUDES = [
432 "gm",
433 "src/codec",
434 "src/effects",
435 "src/fonts",
436 "src/pathops",
437 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700438 "src/ports",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700439 "src/utils/debugger",
440 "tests",
441 "tools",
442 "tools/flags",
443 "tools/timer",
444]
445
benjaminwagner56f6d062016-01-13 10:45:19 -0800446################################################################################
447## DM_ARGS
448################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700449
benjaminwagner56f6d062016-01-13 10:45:19 -0800450def DM_ARGS(base_dir):
451 return [
452 "--nogpu",
453 "--verbose",
454 # TODO(mtklein): maybe investigate why these fail?
455 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds",
456 "--resourcePath %s/resources" % base_dir,
457 "--images %s/resources" % base_dir,
458 ]
459
460################################################################################
461## COPTS
462################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800463
benjaminwagner86ea33e2015-10-26 10:46:25 -0700464COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700465 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700466 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700467]
468
benjaminwagner56f6d062016-01-13 10:45:19 -0800469COPTS_ANDROID = ["-mfpu=neon"]
470
471COPTS_IOS = []
472
473COPTS_ALL = []
474
475################################################################################
476## DEFINES
477################################################################################
478
479DEFINES_UNIX = [
480 "SK_BUILD_FOR_UNIX",
481 "SK_SAMPLES_FOR_X",
482 "SK_SFNTLY_SUBSETTER",
483]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700484
485DEFINES_ANDROID = [
486 "SK_BUILD_FOR_ANDROID",
487 # TODO(benjaminwagner): Try to get png library updated?
488 "SK_PNG_NO_INDEX_SUPPORTED",
489]
490
iroth8b99ef42015-11-02 11:11:21 -0800491DEFINES_IOS = [
492 "SK_BUILD_FOR_IOS",
493 "SK_IGNORE_ETC1_SUPPORT",
irothd2ccc772016-01-25 11:24:57 -0800494 "SKNX_NO_SIMD",
iroth8b99ef42015-11-02 11:11:21 -0800495]
496
benjaminwagner86ea33e2015-10-26 10:46:25 -0700497DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700498 # Chrome DEFINES.
499 "SK_USE_FLOATBITS",
500 "SK_USE_FREETYPE_EMBOLDEN",
501 # Turn on a few Google3-specific build fixes.
502 "GOOGLE3",
benjaminwagner787ca872015-08-17 12:58:10 -0700503]
504
benjaminwagner56f6d062016-01-13 10:45:19 -0800505################################################################################
506## LINKOPTS
507################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700508
benjaminwagner56f6d062016-01-13 10:45:19 -0800509LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700510
benjaminwagner56f6d062016-01-13 10:45:19 -0800511LINKOPTS_ANDROID = [
512 "-lEGL",
513]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700514
benjaminwagner56f6d062016-01-13 10:45:19 -0800515LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700516
benjaminwagner56f6d062016-01-13 10:45:19 -0800517LINKOPTS_ALL = [
518 "-ldl",
519]