blob: 33ba89b6fbe510b4eaa69ab3e0eace6928c9f8e5 [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.
iroth76a12252016-01-07 07:11:39 -080073 "src/codec/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070074 "src/device/xps/*", # Windows-only. Move to ports?
75 "src/doc/*_XPS.cpp", # Windows-only. Move to ports?
benjaminwagner2211a7b2015-12-01 11:12:05 -080076 "src/fonts/SkFontMgr_fontconfig.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070077 "src/gpu/gl/android/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -070078 "src/gpu/gl/egl/*",
79 "src/gpu/gl/glx/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070080 "src/gpu/gl/iOS/*",
81 "src/gpu/gl/mac/*",
82 "src/gpu/gl/win/*",
iroth76a12252016-01-07 07:11:39 -080083 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070084 "src/opts/**/*",
85 "src/ports/**/*",
86 "src/utils/android/**/*",
87 "src/utils/mac/**/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -070088 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports?
89 "src/utils/win/**/*",
90 "src/views/sdl/*",
91 "src/views/win/*",
92 "src/views/unix/*",
93
94 # Exclude multiple definitions.
95 # TODO(mtklein): Move to opts?
mtkleind55d13a2015-08-18 08:51:49 -070096 "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp.
benjaminwagner86ea33e2015-10-26 10:46:25 -070097 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
98 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -070099
100 # Exclude files that don't compile with the current DEFINES.
101 "src/gpu/gl/angle/*", # Requires SK_ANGLE define.
102 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE'
103 "src/gpu/gl/mesa/*", # Requires SK_MESA define.
104 "src/svg/parser/*", # Missing SkSVG.h.
105
benjaminwagner39e7aa42015-11-18 13:26:10 -0800106 # Conflicting dependencies among Lua versions. See cl/107087297.
107 "src/utils/SkLua*",
108
benjaminwagner6f6bef82015-10-15 08:09:44 -0700109 # Not used.
110 "src/animator/**/*",
111 "src/views/**/*",
112 "src/xml/SkBML_Verbs.h",
113 "src/xml/SkBML_XMLParser.cpp",
114 "src/xml/SkXMLPullParser.cpp",
115 ],
116)
117
118# Platform-dependent SRCS for google3-default platform.
benjaminwagner56f6d062016-01-13 10:45:19 -0800119BASE_SRCS_UNIX = struct(
120 include = [
iroth76a12252016-01-07 07:11:39 -0800121 "src/codec/*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800122 "src/fonts/SkFontMgr_fontconfig.cpp",
iroth76a12252016-01-07 07:11:39 -0800123 "src/images/*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700124 "src/opts/**/*.cpp",
125 "src/opts/**/*.h",
126 "src/ports/**/*.cpp",
127 "src/ports/**/*.h",
128 ],
129 exclude = [
iroth76a12252016-01-07 07:11:39 -0800130 "src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700131 "src/opts/*arm*",
132 "src/opts/*mips*",
133 "src/opts/*NEON*",
134 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700135 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700136 "src/opts/*SSSE3*",
137 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700138 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700139 "src/opts/*SSE4*",
140 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800141 # Included in :opts_avx or :opts_avx2
142 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700143 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700144 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700145 "src/opts/SkBlitRow_opts_none.cpp",
146 "src/ports/*android*",
147 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700148 "src/ports/*mac*",
149 "src/ports/*mozalloc*",
150 "src/ports/*nacl*",
151 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800152 "src/ports/SkFontConfigInterface_direct_factory.cpp",
153 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700154 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
155 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800156 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800157 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800158 "src/ports/SkFontMgr_fontconfig_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700159 "src/ports/SkImageDecoder_WIC.cpp",
160 "src/ports/SkImageDecoder_empty.cpp",
161 "src/ports/SkImageGenerator_none.cpp",
162 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700163 ],
164)
165
benjaminwagner86ea33e2015-10-26 10:46:25 -0700166# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800167BASE_SRCS_ANDROID = struct(
168 include = [
iroth76a12252016-01-07 07:11:39 -0800169 "src/codec/*",
170 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700171 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700172 "src/opts/**/*.cpp",
173 "src/opts/**/*.h",
174 "src/ports/**/*.cpp",
175 "src/ports/**/*.h",
176 ],
177 exclude = [
iroth76a12252016-01-07 07:11:39 -0800178 "src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700179 "src/opts/*mips*",
180 "src/opts/*SSE2*",
181 "src/opts/*SSSE3*",
182 "src/opts/*ssse3*",
183 "src/opts/*SSE4*",
184 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800185 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700186 "src/opts/*x86*",
187 "src/opts/SkBitmapProcState_opts_none.cpp",
188 "src/opts/SkBlitMask_opts_none.cpp",
189 "src/opts/SkBlitRow_opts_none.cpp",
190 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700191 "src/ports/*fontconfig*",
192 "src/ports/*FontConfig*",
193 "src/ports/*mac*",
194 "src/ports/*mozalloc*",
195 "src/ports/*nacl*",
196 "src/ports/*win*",
197 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800198 "src/ports/SkFontConfigInterface_direct_factory.cpp",
199 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700200 "src/ports/SkFontMgr_custom_directory_factory.cpp",
201 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
202 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800203 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700204 "src/ports/SkImageDecoder_WIC.cpp",
205 "src/ports/SkImageDecoder_empty.cpp",
206 "src/ports/SkImageGenerator_none.cpp",
207 "src/ports/SkTLS_none.cpp",
208 ],
209)
210
iroth8b99ef42015-11-02 11:11:21 -0800211# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800212BASE_SRCS_IOS = struct(
213 include = [
iroth8b99ef42015-11-02 11:11:21 -0800214 "src/opts/**/*.cpp",
215 "src/opts/**/*.h",
216 "src/ports/**/*.cpp",
217 "src/ports/**/*.h",
218 ],
219 exclude = [
220 "src/opts/*mips*",
221 "src/opts/*NEON*",
222 "src/opts/*neon*",
223 "src/opts/*SSE2*",
224 "src/opts/*SSSE3*",
225 "src/opts/*ssse3*",
226 "src/opts/*SSE4*",
227 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800228 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800229 "src/opts/*x86*",
230 "src/opts/SkBitmapProcState_opts_none.cpp",
231 "src/opts/SkBlitMask_opts_none.cpp",
232 "src/opts/SkBlitRow_opts_none.cpp",
233 "src/ports/*android*",
234 "src/ports/*chromium*",
235 "src/ports/*fontconfig*",
236 "src/ports/*FontConfig*",
237 "src/ports/*FreeType*",
238 "src/ports/*mozalloc*",
239 "src/ports/*nacl*",
240 "src/ports/*win*",
241 "src/ports/SkDebug_stdio.cpp",
242 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800243 "src/ports/SkFontConfigInterface_direct_factory.cpp",
244 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800245 "src/ports/SkFontMgr_custom_directory_factory.cpp",
246 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
247 "src/ports/SkFontMgr_empty_factory.cpp",
248 "src/ports/SkImageDecoder_CG.cpp",
249 "src/ports/SkImageDecoder_WIC.cpp",
250 "src/ports/SkImageDecoder_empty.cpp",
251 "src/ports/SkImageGenerator_none.cpp",
252 "src/ports/SkTLS_none.cpp",
253 ],
254)
255
benjaminwagner56f6d062016-01-13 10:45:19 -0800256################################################################################
257## SSSE3/SSE4/AVX/AVX2 SRCS
258################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700259
benjaminwagner56f6d062016-01-13 10:45:19 -0800260SSSE3_SRCS = struct(
261 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700262 "src/opts/*SSSE3*.cpp",
263 "src/opts/*ssse3*.cpp",
benjaminwagner56f6d062016-01-13 10:45:19 -0800264 ])
mtkleind55d13a2015-08-18 08:51:49 -0700265
benjaminwagner56f6d062016-01-13 10:45:19 -0800266SSE4_SRCS = struct(
267 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700268 "src/opts/*SSE4*.cpp",
269 "src/opts/*sse4*.cpp",
benjaminwagner56f6d062016-01-13 10:45:19 -0800270 ])
benjaminwagner787ca872015-08-17 12:58:10 -0700271
benjaminwagner56f6d062016-01-13 10:45:19 -0800272AVX_SRCS = struct(
273 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800274 "src/opts/*_avx.cpp",
benjaminwagner56f6d062016-01-13 10:45:19 -0800275 ])
mtkleinf6d8d282015-12-17 10:18:04 -0800276
benjaminwagner56f6d062016-01-13 10:45:19 -0800277AVX2_SRCS = struct(
278 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800279 "src/opts/*_avx2.cpp",
benjaminwagner56f6d062016-01-13 10:45:19 -0800280 ])
mtkleinf6d8d282015-12-17 10:18:04 -0800281
benjaminwagner56f6d062016-01-13 10:45:19 -0800282################################################################################
283## BASE_HDRS
284################################################################################
285
286BASE_HDRS = struct(
287 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700288 "include/**/*.h",
289 ],
mtkleind55d13a2015-08-18 08:51:49 -0700290 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700291 "include/private/**/*",
292
293 # Not used.
294 "include/animator/**/*",
295 "include/views/**/*",
296 "include/xml/SkBML_WXMLParser.h",
297 "include/xml/SkBML_XMLParser.h",
benjaminwagner56f6d062016-01-13 10:45:19 -0800298 ])
benjaminwagner787ca872015-08-17 12:58:10 -0700299
benjaminwagner56f6d062016-01-13 10:45:19 -0800300################################################################################
301## BASE_DEPS
302################################################################################
303
304BASE_DEPS_ALL = []
305
benjaminwagner39e7aa42015-11-18 13:26:10 -0800306BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800307 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800308 ":opts_sse4",
309 ":opts_avx",
310 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800311]
312
313BASE_DEPS_ANDROID = []
314
315BASE_DEPS_IOS = []
316
benjaminwagner56f6d062016-01-13 10:45:19 -0800317################################################################################
318## INCLUDES
319################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800320
benjaminwagner787ca872015-08-17 12:58:10 -0700321# Includes needed by Skia implementation. Not public includes.
322INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800323 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700324 "include/c",
325 "include/codec",
326 "include/config",
327 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700328 "include/effects",
329 "include/gpu",
330 "include/images",
331 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700332 "include/pipe",
333 "include/ports",
334 "include/private",
335 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800336 "include/utils/mac",
337 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700338 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700339 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800340 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700341 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700342 "src/gpu",
343 "src/image",
344 "src/lazy",
345 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800346 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700347 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700348 "src/sfnt",
349 "src/utils",
350 "third_party/etc1",
351 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800352]
benjaminwagner787ca872015-08-17 12:58:10 -0700353
benjaminwagner56f6d062016-01-13 10:45:19 -0800354################################################################################
355## DM_SRCS
356################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700357
benjaminwagner56f6d062016-01-13 10:45:19 -0800358DM_SRCS_ALL = struct(
359 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700360 "dm/*.cpp",
361 "dm/*.h",
362 "gm/*.c",
363 "gm/*.cpp",
364 "gm/*.h",
365 "tests/*.cpp",
366 "tests/*.h",
367 "tools/CrashHandler.cpp",
368 "tools/CrashHandler.h",
369 "tools/LazyDecodeBitmap.cpp",
370 "tools/LazyDecodeBitmap.h",
371 "tools/ProcStats.cpp",
372 "tools/ProcStats.h",
373 "tools/Resources.cpp",
374 "tools/Resources.h",
benjaminwagner32885142015-10-24 07:55:31 -0700375 "tools/SkBitmapRegionCanvas.cpp",
376 "tools/SkBitmapRegionCanvas.h",
377 "tools/SkBitmapRegionCodec.cpp",
378 "tools/SkBitmapRegionCodec.h",
msarett5cb48852015-11-06 08:56:32 -0800379 "tools/SkBitmapRegionDecoder.cpp",
380 "tools/SkBitmapRegionDecoder.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700381 "tools/SkBitmapRegionSampler.cpp",
382 "tools/SkBitmapRegionSampler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700383 "tools/flags/*.cpp",
384 "tools/flags/*.h",
benjaminwagner32885142015-10-24 07:55:31 -0700385 "tools/sk_tool_utils.cpp",
386 "tools/sk_tool_utils.h",
387 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700388 "tools/timer/*.cpp",
389 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700390 ],
391 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700392 "dm/DMSrcSinkAndroid.cpp", # Android-only.
393 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
394 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700395 "tests/skia_test.cpp", # Old main.
396 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700397 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700398 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700399 ],
400)
401
benjaminwagner56f6d062016-01-13 10:45:19 -0800402DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700403
benjaminwagner56f6d062016-01-13 10:45:19 -0800404DM_SRCS_ANDROID = struct(
405 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700406 # Depends on Android HWUI library that is not available in google3.
407 #"dm/DMSrcSinkAndroid.cpp",
408 "tests/FontMgrAndroidParserTest.cpp",
409 ],
410)
411
benjaminwagner56f6d062016-01-13 10:45:19 -0800412DM_SRCS_IOS = struct()
413
414################################################################################
415## DM_INCLUDES
416################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700417
benjaminwagner6f6bef82015-10-15 08:09:44 -0700418DM_INCLUDES = [
419 "gm",
420 "src/codec",
421 "src/effects",
422 "src/fonts",
423 "src/pathops",
424 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700425 "src/ports",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700426 "src/utils/debugger",
427 "tests",
428 "tools",
429 "tools/flags",
430 "tools/timer",
431]
432
benjaminwagner56f6d062016-01-13 10:45:19 -0800433################################################################################
434## DM_ARGS
435################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700436
benjaminwagner56f6d062016-01-13 10:45:19 -0800437def DM_ARGS(base_dir):
438 return [
439 "--nogpu",
440 "--verbose",
441 # TODO(mtklein): maybe investigate why these fail?
442 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds",
443 "--resourcePath %s/resources" % base_dir,
444 "--images %s/resources" % base_dir,
445 ]
446
447################################################################################
448## COPTS
449################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800450
benjaminwagner86ea33e2015-10-26 10:46:25 -0700451COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700452 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700453 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700454]
455
benjaminwagner56f6d062016-01-13 10:45:19 -0800456COPTS_ANDROID = ["-mfpu=neon"]
457
458COPTS_IOS = []
459
460COPTS_ALL = []
461
462################################################################################
463## DEFINES
464################################################################################
465
466DEFINES_UNIX = [
467 "SK_BUILD_FOR_UNIX",
468 "SK_SAMPLES_FOR_X",
469 "SK_SFNTLY_SUBSETTER",
470]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700471
472DEFINES_ANDROID = [
473 "SK_BUILD_FOR_ANDROID",
474 # TODO(benjaminwagner): Try to get png library updated?
475 "SK_PNG_NO_INDEX_SUPPORTED",
476]
477
iroth8b99ef42015-11-02 11:11:21 -0800478DEFINES_IOS = [
479 "SK_BUILD_FOR_IOS",
480 "SK_IGNORE_ETC1_SUPPORT",
481]
482
benjaminwagner86ea33e2015-10-26 10:46:25 -0700483DEFINES_ALL = [
benjaminwagner787ca872015-08-17 12:58:10 -0700484 # Chrome DEFINES.
485 "SK_USE_FLOATBITS",
486 "SK_USE_FREETYPE_EMBOLDEN",
487 # Turn on a few Google3-specific build fixes.
488 "GOOGLE3",
benjaminwagner787ca872015-08-17 12:58:10 -0700489]
490
benjaminwagner56f6d062016-01-13 10:45:19 -0800491################################################################################
492## LINKOPTS
493################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700494
benjaminwagner56f6d062016-01-13 10:45:19 -0800495LINKOPTS_UNIX = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700496
benjaminwagner56f6d062016-01-13 10:45:19 -0800497LINKOPTS_ANDROID = [
498 "-lEGL",
499]
benjaminwagner6f6bef82015-10-15 08:09:44 -0700500
benjaminwagner56f6d062016-01-13 10:45:19 -0800501LINKOPTS_IOS = []
benjaminwagner6f6bef82015-10-15 08:09:44 -0700502
benjaminwagner56f6d062016-01-13 10:45:19 -0800503LINKOPTS_ALL = [
504 "-ldl",
505]
mtkleinf6d8d282015-12-17 10:18:04 -0800506