blob: db92502797658a1d87f0cb48e5c1eba299f01532 [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 = [
132 "src/opts/*arm*",
133 "src/opts/*mips*",
134 "src/opts/*NEON*",
135 "src/opts/*neon*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700136 # Included in :opts_ssse3 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700137 "src/opts/*SSSE3*",
138 "src/opts/*ssse3*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700139 # Included in :opts_sse4 library.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700140 "src/opts/*SSE4*",
141 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800142 # Included in :opts_avx or :opts_avx2
143 "src/opts/*avx*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700144 "src/opts/SkBitmapProcState_opts_none.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700145 "src/opts/SkBlitMask_opts_none.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700146 "src/opts/SkBlitRow_opts_none.cpp",
147 "src/ports/*android*",
148 "src/ports/*chromium*",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700149 "src/ports/*mac*",
150 "src/ports/*mozalloc*",
151 "src/ports/*nacl*",
152 "src/ports/*win*",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800153 "src/ports/SkFontConfigInterface_direct_factory.cpp",
154 "src/ports/SkFontMgr_custom_directory_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700155 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
156 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner404816e2015-12-03 05:04:03 -0800157 "src/ports/SkFontMgr_fontconfig.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800158 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800159 "src/ports/SkFontMgr_fontconfig_factory.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700160 "src/ports/SkImageDecoder_WIC.cpp",
161 "src/ports/SkImageDecoder_empty.cpp",
162 "src/ports/SkImageGenerator_none.cpp",
163 "src/ports/SkTLS_none.cpp",
mtkleind55d13a2015-08-18 08:51:49 -0700164 ],
165)
166
benjaminwagner86ea33e2015-10-26 10:46:25 -0700167# Platform-dependent SRCS for google3-default Android.
benjaminwagner56f6d062016-01-13 10:45:19 -0800168BASE_SRCS_ANDROID = struct(
169 include = [
irothd2ccc772016-01-25 11:24:57 -0800170 "src/android/*",
iroth76a12252016-01-07 07:11:39 -0800171 "src/codec/*",
172 "src/images/*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700173 # TODO(benjaminwagner): Figure out how to compile with EGL.
benjaminwagner86ea33e2015-10-26 10:46:25 -0700174 "src/opts/**/*.cpp",
175 "src/opts/**/*.h",
176 "src/ports/**/*.cpp",
177 "src/ports/**/*.h",
178 ],
179 exclude = [
180 "src/opts/*mips*",
181 "src/opts/*SSE2*",
182 "src/opts/*SSSE3*",
183 "src/opts/*ssse3*",
184 "src/opts/*SSE4*",
185 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800186 "src/opts/*avx*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700187 "src/opts/*x86*",
188 "src/opts/SkBitmapProcState_opts_none.cpp",
189 "src/opts/SkBlitMask_opts_none.cpp",
190 "src/opts/SkBlitRow_opts_none.cpp",
191 "src/ports/*chromium*",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700192 "src/ports/*fontconfig*",
193 "src/ports/*FontConfig*",
194 "src/ports/*mac*",
195 "src/ports/*mozalloc*",
196 "src/ports/*nacl*",
197 "src/ports/*win*",
198 "src/ports/SkDebug_stdio.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800199 "src/ports/SkFontConfigInterface_direct_factory.cpp",
200 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700201 "src/ports/SkFontMgr_custom_directory_factory.cpp",
202 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
203 "src/ports/SkFontMgr_empty_factory.cpp",
benjaminwagner9dbec092015-11-02 05:53:38 -0800204 "src/ports/SkImageDecoder_CG.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700205 "src/ports/SkImageDecoder_WIC.cpp",
206 "src/ports/SkImageDecoder_empty.cpp",
207 "src/ports/SkImageGenerator_none.cpp",
208 "src/ports/SkTLS_none.cpp",
209 ],
210)
211
iroth8b99ef42015-11-02 11:11:21 -0800212# Platform-dependent SRCS for google3-default iOS.
benjaminwagner56f6d062016-01-13 10:45:19 -0800213BASE_SRCS_IOS = struct(
214 include = [
iroth8b99ef42015-11-02 11:11:21 -0800215 "src/opts/**/*.cpp",
216 "src/opts/**/*.h",
217 "src/ports/**/*.cpp",
218 "src/ports/**/*.h",
irothab669de2016-02-16 19:17:01 -0800219 "src/utils/mac/*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800220 ],
221 exclude = [
222 "src/opts/*mips*",
223 "src/opts/*NEON*",
224 "src/opts/*neon*",
225 "src/opts/*SSE2*",
226 "src/opts/*SSSE3*",
227 "src/opts/*ssse3*",
228 "src/opts/*SSE4*",
229 "src/opts/*sse4*",
mtkleinf6d8d282015-12-17 10:18:04 -0800230 "src/opts/*avx*",
iroth8b99ef42015-11-02 11:11:21 -0800231 "src/opts/*x86*",
232 "src/opts/SkBitmapProcState_opts_none.cpp",
irothd2ccc772016-01-25 11:24:57 -0800233 "src/opts/SkBlitMask_opts_arm*.cpp",
234 "src/opts/SkBlitRow_opts_arm*.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800235 "src/ports/*android*",
236 "src/ports/*chromium*",
237 "src/ports/*fontconfig*",
238 "src/ports/*FontConfig*",
239 "src/ports/*FreeType*",
240 "src/ports/*mozalloc*",
241 "src/ports/*nacl*",
242 "src/ports/*win*",
iroth8b99ef42015-11-02 11:11:21 -0800243 "src/ports/SkFontMgr_custom.cpp",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800244 "src/ports/SkFontConfigInterface_direct_factory.cpp",
245 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800246 "src/ports/SkFontMgr_custom_directory_factory.cpp",
247 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
248 "src/ports/SkFontMgr_empty_factory.cpp",
249 "src/ports/SkImageDecoder_CG.cpp",
250 "src/ports/SkImageDecoder_WIC.cpp",
iroth8b99ef42015-11-02 11:11:21 -0800251 "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",
benjaminwagner89061ed2016-01-25 09:29:08 -0800264 ],
265)
mtkleind55d13a2015-08-18 08:51:49 -0700266
benjaminwagner56f6d062016-01-13 10:45:19 -0800267SSE4_SRCS = struct(
268 include = [
mtkleind55d13a2015-08-18 08:51:49 -0700269 "src/opts/*SSE4*.cpp",
270 "src/opts/*sse4*.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800271 ],
272)
benjaminwagner787ca872015-08-17 12:58:10 -0700273
benjaminwagner56f6d062016-01-13 10:45:19 -0800274AVX_SRCS = struct(
275 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800276 "src/opts/*_avx.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800277 ],
278)
mtkleinf6d8d282015-12-17 10:18:04 -0800279
benjaminwagner56f6d062016-01-13 10:45:19 -0800280AVX2_SRCS = struct(
281 include = [
mtkleinf6d8d282015-12-17 10:18:04 -0800282 "src/opts/*_avx2.cpp",
benjaminwagner89061ed2016-01-25 09:29:08 -0800283 ],
284)
mtkleinf6d8d282015-12-17 10:18:04 -0800285
benjaminwagner56f6d062016-01-13 10:45:19 -0800286################################################################################
287## BASE_HDRS
288################################################################################
289
290BASE_HDRS = struct(
291 include = [
benjaminwagner787ca872015-08-17 12:58:10 -0700292 "include/**/*.h",
irothd2ccc772016-01-25 11:24:57 -0800293 "src/utils/SkWhitelistChecksums.cpp",
benjaminwagner787ca872015-08-17 12:58:10 -0700294 ],
mtkleind55d13a2015-08-18 08:51:49 -0700295 exclude = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700296 "include/private/**/*",
297
298 # Not used.
299 "include/animator/**/*",
300 "include/views/**/*",
301 "include/xml/SkBML_WXMLParser.h",
302 "include/xml/SkBML_XMLParser.h",
benjaminwagner89061ed2016-01-25 09:29:08 -0800303 ],
304)
benjaminwagner787ca872015-08-17 12:58:10 -0700305
benjaminwagner56f6d062016-01-13 10:45:19 -0800306################################################################################
307## BASE_DEPS
308################################################################################
309
310BASE_DEPS_ALL = []
311
benjaminwagner39e7aa42015-11-18 13:26:10 -0800312BASE_DEPS_UNIX = [
iroth330043c2016-01-12 14:22:24 -0800313 ":opts_ssse3",
benjaminwagner56f6d062016-01-13 10:45:19 -0800314 ":opts_sse4",
315 ":opts_avx",
316 ":opts_avx2",
benjaminwagner39e7aa42015-11-18 13:26:10 -0800317]
318
319BASE_DEPS_ANDROID = []
320
321BASE_DEPS_IOS = []
322
benjaminwagner56f6d062016-01-13 10:45:19 -0800323################################################################################
324## INCLUDES
325################################################################################
benjaminwagner39e7aa42015-11-18 13:26:10 -0800326
benjaminwagner787ca872015-08-17 12:58:10 -0700327# Includes needed by Skia implementation. Not public includes.
328INCLUDES = [
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800329 "include/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700330 "include/c",
robertphillips188d44c2016-02-01 04:54:14 -0800331 "include/client/android",
benjaminwagner787ca872015-08-17 12:58:10 -0700332 "include/codec",
333 "include/config",
334 "include/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700335 "include/effects",
336 "include/gpu",
337 "include/images",
338 "include/pathops",
benjaminwagner787ca872015-08-17 12:58:10 -0700339 "include/pipe",
340 "include/ports",
341 "include/private",
342 "include/utils",
iroth8b99ef42015-11-02 11:11:21 -0800343 "include/utils/mac",
344 "include/utils/win",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700345 "include/svg",
benjaminwagner787ca872015-08-17 12:58:10 -0700346 "include/xml",
benjaminwagnerfa7e1a02015-11-13 12:27:08 -0800347 "src/codec",
benjaminwagner787ca872015-08-17 12:58:10 -0700348 "src/core",
benjaminwagner787ca872015-08-17 12:58:10 -0700349 "src/gpu",
350 "src/image",
351 "src/lazy",
352 "src/opts",
benjaminwagner2211a7b2015-12-01 11:12:05 -0800353 "src/ports",
benjaminwagner787ca872015-08-17 12:58:10 -0700354 "src/pdf",
benjaminwagner787ca872015-08-17 12:58:10 -0700355 "src/sfnt",
356 "src/utils",
357 "third_party/etc1",
358 "third_party/ktx",
benjaminwagner56f6d062016-01-13 10:45:19 -0800359]
benjaminwagner787ca872015-08-17 12:58:10 -0700360
benjaminwagner56f6d062016-01-13 10:45:19 -0800361################################################################################
362## DM_SRCS
363################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700364
benjaminwagner56f6d062016-01-13 10:45:19 -0800365DM_SRCS_ALL = struct(
366 include = [
benjaminwagner6f6bef82015-10-15 08:09:44 -0700367 "dm/*.cpp",
368 "dm/*.h",
369 "gm/*.c",
370 "gm/*.cpp",
371 "gm/*.h",
372 "tests/*.cpp",
373 "tests/*.h",
374 "tools/CrashHandler.cpp",
375 "tools/CrashHandler.h",
kjlubick1de415f2016-02-10 11:25:07 -0800376 "tools/LazyDecodeBitmap.cpp",
377 "tools/LazyDecodeBitmap.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700378 "tools/ProcStats.cpp",
379 "tools/ProcStats.h",
380 "tools/Resources.cpp",
381 "tools/Resources.h",
benjaminwagner32885142015-10-24 07:55:31 -0700382 "tools/SkBitmapRegionCanvas.cpp",
383 "tools/SkBitmapRegionCanvas.h",
384 "tools/SkBitmapRegionCodec.cpp",
385 "tools/SkBitmapRegionCodec.h",
msarett5cb48852015-11-06 08:56:32 -0800386 "tools/SkBitmapRegionDecoder.cpp",
387 "tools/SkBitmapRegionDecoder.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700388 "tools/SkBitmapRegionSampler.cpp",
389 "tools/SkBitmapRegionSampler.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700390 "tools/flags/*.cpp",
391 "tools/flags/*.h",
mtkleine1fc4522016-02-09 12:32:52 -0800392 "tools/random_parse_path.cpp",
393 "tools/random_parse_path.h",
benjaminwagner32885142015-10-24 07:55:31 -0700394 "tools/sk_tool_utils.cpp",
395 "tools/sk_tool_utils.h",
396 "tools/sk_tool_utils_font.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700397 "tools/timer/*.cpp",
398 "tools/timer/*.h",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700399 ],
400 exclude = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700401 "dm/DMSrcSinkAndroid.cpp", # Android-only.
402 "tests/FontMgrAndroidParserTest.cpp", # Android-only.
403 "tests/PathOpsSkpClipTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700404 "tests/skia_test.cpp", # Old main.
405 "tests/SkpSkGrTest.cpp", # Alternate main.
benjaminwagner6f6bef82015-10-15 08:09:44 -0700406 "tools/timer/SysTimer_mach.cpp",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700407 "tools/timer/SysTimer_windows.cpp",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700408 ],
409)
410
benjaminwagner56f6d062016-01-13 10:45:19 -0800411DM_SRCS_UNIX = struct()
benjaminwagner86ea33e2015-10-26 10:46:25 -0700412
benjaminwagner56f6d062016-01-13 10:45:19 -0800413DM_SRCS_ANDROID = struct(
414 include = [
benjaminwagner86ea33e2015-10-26 10:46:25 -0700415 # Depends on Android HWUI library that is not available in google3.
416 #"dm/DMSrcSinkAndroid.cpp",
417 "tests/FontMgrAndroidParserTest.cpp",
418 ],
419)
420
benjaminwagner56f6d062016-01-13 10:45:19 -0800421DM_SRCS_IOS = struct()
422
423################################################################################
424## DM_INCLUDES
425################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700426
benjaminwagner6f6bef82015-10-15 08:09:44 -0700427DM_INCLUDES = [
benjaminwagnerb1fe8f62016-02-01 09:05:08 -0800428 "dm",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700429 "gm",
430 "src/codec",
431 "src/effects",
432 "src/fonts",
433 "src/pathops",
434 "src/pipe/utils",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700435 "src/ports",
ethannicholas3cb95422016-02-09 12:44:06 -0800436 "tools/debugger",
benjaminwagner6f6bef82015-10-15 08:09:44 -0700437 "tests",
438 "tools",
439 "tools/flags",
440 "tools/timer",
441]
442
benjaminwagner56f6d062016-01-13 10:45:19 -0800443################################################################################
444## DM_ARGS
445################################################################################
benjaminwagner86ea33e2015-10-26 10:46:25 -0700446
benjaminwagner56f6d062016-01-13 10:45:19 -0800447def DM_ARGS(base_dir):
448 return [
449 "--nogpu",
450 "--verbose",
451 # TODO(mtklein): maybe investigate why these fail?
452 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds",
453 "--resourcePath %s/resources" % base_dir,
454 "--images %s/resources" % base_dir,
455 ]
456
457################################################################################
458## COPTS
459################################################################################
iroth8b99ef42015-11-02 11:11:21 -0800460
benjaminwagner86ea33e2015-10-26 10:46:25 -0700461COPTS_UNIX = [
benjaminwagner787ca872015-08-17 12:58:10 -0700462 "-Wno-implicit-fallthrough", # Some intentional fallthrough.
benjaminwagner7d974f52015-10-19 13:55:55 -0700463 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :(
benjaminwagner787ca872015-08-17 12:58:10 -0700464]
465
benjaminwagner56f6d062016-01-13 10:45:19 -0800466COPTS_ANDROID = ["-mfpu=neon"]
467
468COPTS_IOS = []
469
470COPTS_ALL = []
471
472################################################################################
473## DEFINES
474################################################################################
475
476DEFINES_UNIX = [
msarett70e418b2016-02-12 12:35:48 -0800477 "PNG_SKIP_SETJMP_CHECK",
benjaminwagner56f6d062016-01-13 10:45:19 -0800478 "SK_BUILD_FOR_UNIX",
479 "SK_SAMPLES_FOR_X",
480 "SK_SFNTLY_SUBSETTER",
benjaminwagner186e0b92016-02-11 16:00:24 -0800481 "SK_CODEC_DECODES_RAW",
benjaminwagner56f6d062016-01-13 10:45:19 -0800482]
benjaminwagner86ea33e2015-10-26 10:46:25 -0700483
484DEFINES_ANDROID = [
485 "SK_BUILD_FOR_ANDROID",
486 # TODO(benjaminwagner): Try to get png library updated?
487 "SK_PNG_NO_INDEX_SUPPORTED",
benjaminwagner186e0b92016-02-11 16:00:24 -0800488 "SK_CODEC_DECODES_RAW",
benjaminwagner86ea33e2015-10-26 10:46:25 -0700489]
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]