OLD | NEW |
1 # Description: | 1 # Description: |
2 # Skia graphics library. | 2 # Skia graphics library. |
3 # | 3 # |
4 # Definitions for Google BUILD file. | 4 # Definitions for Google BUILD file. |
5 | 5 |
6 exports_files(["BUILD.public"]) | 6 exports_files(["BUILD.public"]) |
7 | 7 |
8 # Platform-independent SRCS | 8 # Platform-independent SRCS |
9 SRCS = glob( | 9 SRCS = glob( |
10 [ | 10 [ |
11 "include/private/*.h", | 11 "include/private/*.h", |
12 "src/**/*.h", | 12 "src/**/*.h", |
13 "src/**/*.cpp", | 13 "src/**/*.cpp", |
14 "src/**/*.c", | |
15 | 14 |
16 # Third Party | 15 # Third Party |
17 "third_party/etc1/*.cpp", | 16 "third_party/etc1/*.cpp", |
18 "third_party/etc1/*.h", | 17 "third_party/etc1/*.h", |
19 "third_party/ktx/*.cpp", | 18 "third_party/ktx/*.cpp", |
20 "third_party/ktx/*.h", | 19 "third_party/ktx/*.h", |
21 ], | 20 ], |
22 exclude = [ | 21 exclude = [ |
23 # Exclude platform-dependent files. | 22 # Exclude platform-dependent files. |
24 "src/device/xps/*", # Windows-only. Move to ports? | 23 "src/device/xps/*", # Windows-only. Move to ports? |
25 "src/doc/*_XPS.cpp", # Windows-only. Move to ports? | 24 "src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
26 "src/gpu/gl/android/*", | 25 "src/gpu/gl/android/*", |
| 26 "src/gpu/gl/egl/*", |
| 27 "src/gpu/gl/glx/*", |
| 28 "src/gpu/gl/nacl/*", |
27 "src/gpu/gl/iOS/*", | 29 "src/gpu/gl/iOS/*", |
28 "src/gpu/gl/mac/*", | 30 "src/gpu/gl/mac/*", |
29 "src/gpu/gl/win/*", | 31 "src/gpu/gl/win/*", |
30 "src/opts/**/*", | 32 "src/opts/**/*", |
31 "src/ports/**/*", | 33 "src/ports/**/*", |
32 "src/utils/android/**/*", | 34 "src/utils/android/**/*", |
33 "src/utils/mac/**/*", | 35 "src/utils/mac/**/*", |
34 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? | 36 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? |
35 "src/utils/win/**/*", | 37 "src/utils/win/**/*", |
36 "src/views/sdl/*", | 38 "src/views/sdl/*", |
37 "src/views/win/*", | 39 "src/views/win/*", |
38 "src/views/unix/*", | 40 "src/views/unix/*", |
39 | 41 |
40 # Exclude multiple definitions. | 42 # Exclude multiple definitions. |
41 # TODO(mtklein): Move to opts? | 43 # TODO(mtklein): Move to opts? |
42 "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. | 44 "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. |
43 "src/fonts/*fontconfig*", | 45 "src/fonts/*fontconfig*", |
44 "src/gpu/gl/egl/*", # Conflicts with gpu/gl/glx. | 46 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
45 "src/gpu/gl/nacl/*", # Conflicts with gpu/gl/glx. | 47 "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
46 "src/gpu/gl/GrGLDefaultInterface_none.cpp", # Conflicts with src/gpu/gl
/GrGLDefaultInterface_native.cpp | 48 "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
47 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", # Conflicts with src/g
pu/gl/glx/GrGLCreateNativeInterface_glx.cpp | |
48 | 49 |
49 # Exclude files that don't compile with the current DEFINES. | 50 # Exclude files that don't compile with the current DEFINES. |
50 "src/gpu/gl/angle/*", # Requires SK_ANGLE define. | 51 "src/gpu/gl/angle/*", # Requires SK_ANGLE define. |
51 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' | 52 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' |
52 "src/gpu/gl/mesa/*", # Requires SK_MESA define. | 53 "src/gpu/gl/mesa/*", # Requires SK_MESA define. |
53 "src/svg/parser/*", # Missing SkSVG.h. | 54 "src/svg/parser/*", # Missing SkSVG.h. |
54 | 55 |
55 # Not used. | 56 # Not used. |
56 "src/animator/**/*", | 57 "src/animator/**/*", |
57 "src/views/**/*", | 58 "src/views/**/*", |
58 "src/xml/SkBML_Verbs.h", | 59 "src/xml/SkBML_Verbs.h", |
59 "src/xml/SkBML_XMLParser.cpp", | 60 "src/xml/SkBML_XMLParser.cpp", |
60 "src/xml/SkXMLPullParser.cpp", | 61 "src/xml/SkXMLPullParser.cpp", |
61 ], | 62 ], |
62 ) | 63 ) |
63 | 64 |
64 # Platform-dependent SRCS for google3-default platform. | 65 # Platform-dependent SRCS for google3-default platform. |
65 PLATFORM_SRCS = glob( | 66 SRCS_UNIX = glob( |
66 [ | 67 [ |
| 68 "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
| 69 "src/gpu/gl/glx/**/*.cpp", |
| 70 "src/gpu/gl/glx/**/*.h", |
67 "src/opts/**/*.cpp", | 71 "src/opts/**/*.cpp", |
68 "src/opts/**/*.h", | 72 "src/opts/**/*.h", |
69 "src/ports/**/*.cpp", | 73 "src/ports/**/*.cpp", |
70 "src/ports/**/*.h", | 74 "src/ports/**/*.h", |
71 ], | 75 ], |
72 exclude = [ | 76 exclude = [ |
73 "src/opts/*arm*", | 77 "src/opts/*arm*", |
74 "src/opts/*mips*", | 78 "src/opts/*mips*", |
75 "src/opts/*NEON*", | 79 "src/opts/*NEON*", |
76 "src/opts/*neon*", | 80 "src/opts/*neon*", |
| 81 # Included in :opts_ssse3 library. |
77 "src/opts/*SSSE3*", | 82 "src/opts/*SSSE3*", |
78 "src/opts/*ssse3*", | 83 "src/opts/*ssse3*", |
| 84 # Included in :opts_sse4 library. |
79 "src/opts/*SSE4*", | 85 "src/opts/*SSE4*", |
80 "src/opts/*sse4*", | 86 "src/opts/*sse4*", |
| 87 "src/opts/SkBitmapProcState_opts_none.cpp", |
81 "src/opts/SkBlitMask_opts_none.cpp", | 88 "src/opts/SkBlitMask_opts_none.cpp", |
82 "src/opts/SkBitmapProcState_opts_none.cpp", | |
83 "src/opts/SkBlitRow_opts_none.cpp", | 89 "src/opts/SkBlitRow_opts_none.cpp", |
84 "src/ports/*android*", | 90 "src/ports/*android*", |
85 "src/ports/*chromium*", | 91 "src/ports/*chromium*", |
86 "src/ports/*CG*", | 92 "src/ports/*CG*", |
87 "src/ports/*fontconfig*", | 93 "src/ports/*fontconfig*", |
88 "src/ports/*FontConfig*", | 94 "src/ports/*FontConfig*", |
89 "src/ports/*mac*", | 95 "src/ports/*mac*", |
90 "src/ports/*mozalloc*", | 96 "src/ports/*mozalloc*", |
91 "src/ports/*nacl*", | 97 "src/ports/*nacl*", |
92 "src/ports/*win*", | 98 "src/ports/*win*", |
93 "src/ports/SkFontMgr_custom_embedded_factory.cpp", | 99 "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
94 "src/ports/SkFontMgr_empty_factory.cpp", | 100 "src/ports/SkFontMgr_empty_factory.cpp", |
95 "src/ports/SkImageDecoder_WIC.cpp", | 101 "src/ports/SkImageDecoder_WIC.cpp", |
96 "src/ports/SkImageDecoder_empty.cpp", | 102 "src/ports/SkImageDecoder_empty.cpp", |
97 "src/ports/SkImageGenerator_none.cpp", | 103 "src/ports/SkImageGenerator_none.cpp", |
98 "src/ports/SkTLS_none.cpp", | 104 "src/ports/SkTLS_none.cpp", |
99 ], | 105 ], |
100 ) | 106 ) |
101 | 107 |
| 108 # Platform-dependent SRCS for google3-default Android. |
| 109 SRCS_ANDROID = glob( |
| 110 [ |
| 111 # TODO(benjaminwagner): Figure out how to compile with EGL. |
| 112 "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
| 113 "src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp", |
| 114 "src/opts/**/*.cpp", |
| 115 "src/opts/**/*.h", |
| 116 "src/ports/**/*.cpp", |
| 117 "src/ports/**/*.h", |
| 118 ], |
| 119 exclude = [ |
| 120 "src/opts/*mips*", |
| 121 "src/opts/*SSE2*", |
| 122 "src/opts/*SSSE3*", |
| 123 "src/opts/*ssse3*", |
| 124 "src/opts/*SSE4*", |
| 125 "src/opts/*sse4*", |
| 126 "src/opts/*x86*", |
| 127 "src/opts/SkBitmapProcState_opts_none.cpp", |
| 128 "src/opts/SkBlitMask_opts_none.cpp", |
| 129 "src/opts/SkBlitRow_opts_none.cpp", |
| 130 "src/ports/*chromium*", |
| 131 "src/ports/*CG*", |
| 132 "src/ports/*fontconfig*", |
| 133 "src/ports/*FontConfig*", |
| 134 "src/ports/*mac*", |
| 135 "src/ports/*mozalloc*", |
| 136 "src/ports/*nacl*", |
| 137 "src/ports/*win*", |
| 138 "src/ports/SkDebug_stdio.cpp", |
| 139 "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 140 "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 141 "src/ports/SkFontMgr_empty_factory.cpp", |
| 142 "src/ports/SkImageDecoder_WIC.cpp", |
| 143 "src/ports/SkImageDecoder_empty.cpp", |
| 144 "src/ports/SkImageGenerator_none.cpp", |
| 145 "src/ports/SkTLS_none.cpp", |
| 146 ], |
| 147 ) |
| 148 |
| 149 PLATFORM_SRCS = select({ |
| 150 CONDITION_ANDROID: SRCS_ANDROID, |
| 151 "//conditions:default": SRCS_UNIX, |
| 152 }) |
| 153 |
102 SRCS_SSSE3 = glob( | 154 SRCS_SSSE3 = glob( |
103 [ | 155 [ |
104 "src/opts/*SSSE3*.cpp", | 156 "src/opts/*SSSE3*.cpp", |
105 "src/opts/*ssse3*.cpp", | 157 "src/opts/*ssse3*.cpp", |
106 ], | 158 ], |
107 ) | 159 ) |
108 | 160 |
109 SRCS_SSE4 = glob( | 161 SRCS_SSE4 = glob( |
110 [ | 162 [ |
111 "src/opts/*SSE4*.cpp", | 163 "src/opts/*SSE4*.cpp", |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 "src/image", | 201 "src/image", |
150 "src/lazy", | 202 "src/lazy", |
151 "src/opts", | 203 "src/opts", |
152 "src/pdf", | 204 "src/pdf", |
153 "src/sfnt", | 205 "src/sfnt", |
154 "src/utils", | 206 "src/utils", |
155 "third_party/etc1", | 207 "third_party/etc1", |
156 "third_party/ktx", | 208 "third_party/ktx", |
157 ] | 209 ] |
158 | 210 |
| 211 DEPS_UNIX = [ |
| 212 ":opts_sse4", |
| 213 ":opts_ssse3", |
| 214 ] |
| 215 |
| 216 DEPS_ANDROID = [] |
| 217 |
| 218 DEPS = select({ |
| 219 CONDITION_ANDROID: DEPS_ANDROID + EXTERNAL_DEPS_ANDROID, |
| 220 "//conditions:default": DEPS_UNIX + EXTERNAL_DEPS_UNIX, |
| 221 }) |
| 222 |
| 223 # Platform-independent SRCS for DM. |
159 DM_SRCS = glob( | 224 DM_SRCS = glob( |
160 [ | 225 [ |
161 "dm/*.cpp", | 226 "dm/*.cpp", |
162 "dm/*.h", | 227 "dm/*.h", |
163 "gm/*.c", | 228 "gm/*.c", |
164 "gm/*.cpp", | 229 "gm/*.cpp", |
165 "gm/*.h", | 230 "gm/*.h", |
166 "tests/*.cpp", | 231 "tests/*.cpp", |
167 "tests/*.h", | 232 "tests/*.h", |
168 "tools/CrashHandler.cpp", | 233 "tools/CrashHandler.cpp", |
(...skipping 14 matching lines...) Expand all Loading... |
183 "tools/SkBitmapRegionSampler.h", | 248 "tools/SkBitmapRegionSampler.h", |
184 "tools/flags/*.cpp", | 249 "tools/flags/*.cpp", |
185 "tools/flags/*.h", | 250 "tools/flags/*.h", |
186 "tools/sk_tool_utils.cpp", | 251 "tools/sk_tool_utils.cpp", |
187 "tools/sk_tool_utils.h", | 252 "tools/sk_tool_utils.h", |
188 "tools/sk_tool_utils_font.cpp", | 253 "tools/sk_tool_utils_font.cpp", |
189 "tools/timer/*.cpp", | 254 "tools/timer/*.cpp", |
190 "tools/timer/*.h", | 255 "tools/timer/*.h", |
191 ], | 256 ], |
192 exclude = [ | 257 exclude = [ |
| 258 "dm/DMSrcSinkAndroid.cpp", # Android-only. |
| 259 "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
| 260 "tests/PathOpsSkpClipTest.cpp", # Alternate main. |
193 "tests/skia_test.cpp", # Old main. | 261 "tests/skia_test.cpp", # Old main. |
194 "tests/SkpSkGrTest.cpp", # Alternate main. | 262 "tests/SkpSkGrTest.cpp", # Alternate main. |
195 "tests/PathOpsSkpClipTest.cpp", # Alternate main. | 263 "tools/timer/SysTimer_mach.cpp", |
196 "tests/FontMgrAndroidParserTest.cpp", # Android-only. | |
197 "dm/DMSrcSinkAndroid.cpp", # Android-only. | |
198 "tools/timer/SysTimer_windows.cpp", | 264 "tools/timer/SysTimer_windows.cpp", |
199 "tools/timer/SysTimer_mach.cpp", | |
200 ], | 265 ], |
201 ) | 266 ) |
202 | 267 |
| 268 DM_SRCS_UNIX = [] |
| 269 |
| 270 DM_SRCS_ANDROID = glob( |
| 271 [ |
| 272 # Depends on Android HWUI library that is not available in google3. |
| 273 #"dm/DMSrcSinkAndroid.cpp", |
| 274 "tests/FontMgrAndroidParserTest.cpp", |
| 275 ], |
| 276 ) |
| 277 |
| 278 DM_PLATFORM_SRCS = select({ |
| 279 CONDITION_ANDROID: DM_SRCS_ANDROID, |
| 280 "//conditions:default": DM_SRCS_UNIX, |
| 281 }) |
| 282 |
203 DM_INCLUDES = [ | 283 DM_INCLUDES = [ |
204 "gm", | 284 "gm", |
205 "src/codec", | 285 "src/codec", |
206 "src/effects", | 286 "src/effects", |
207 "src/fonts", | 287 "src/fonts", |
208 "src/pathops", | 288 "src/pathops", |
209 "src/pipe/utils", | 289 "src/pipe/utils", |
| 290 "src/ports", |
210 "src/utils/debugger", | 291 "src/utils/debugger", |
211 "tests", | 292 "tests", |
212 "tools", | 293 "tools", |
213 "tools/flags", | 294 "tools/flags", |
214 "tools/timer", | 295 "tools/timer", |
215 ] | 296 ] |
216 | 297 |
217 COPTS = [ | 298 COPTS_ANDROID = [ |
| 299 "-mfpu=neon", |
| 300 ] |
| 301 |
| 302 COPTS_UNIX = [ |
218 "-Wno-implicit-fallthrough", # Some intentional fallthrough. | 303 "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
219 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( | 304 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( |
220 ] | 305 ] |
221 | 306 |
222 DEFINES = [ | 307 COPTS = select({ |
| 308 CONDITION_ANDROID: COPTS_ANDROID, |
| 309 "//conditions:default": COPTS_UNIX, |
| 310 }) |
| 311 |
| 312 DEFINES_ANDROID = [ |
| 313 "SK_BUILD_FOR_ANDROID", |
| 314 # TODO(benjaminwagner): Try to get png library updated? |
| 315 "SK_PNG_NO_INDEX_SUPPORTED", |
| 316 ] |
| 317 |
| 318 DEFINES_UNIX = [ |
| 319 "SK_BUILD_FOR_UNIX", |
| 320 "SK_SAMPLES_FOR_X", |
| 321 ] |
| 322 |
| 323 DEFINES_ALL = [ |
223 # It'd be nice for fastbuild, dbg -> SK_DEBUG, opt -> SK_RELEASE. | 324 # It'd be nice for fastbuild, dbg -> SK_DEBUG, opt -> SK_RELEASE. |
224 "SK_RELEASE", | 325 "SK_RELEASE", |
225 # Chrome DEFINES. | 326 # Chrome DEFINES. |
226 "SK_USE_FLOATBITS", | 327 "SK_USE_FLOATBITS", |
227 "SK_USE_FREETYPE_EMBOLDEN", | 328 "SK_USE_FREETYPE_EMBOLDEN", |
228 # Turn on a few Google3-specific build fixes. | 329 # Turn on a few Google3-specific build fixes. |
229 "GOOGLE3", | 330 "GOOGLE3", |
230 "SK_BUILD_FOR_UNIX", | |
231 "SK_SAMPLES_FOR_X", | |
232 ] | 331 ] |
233 | 332 |
234 LINKOPTS = ["-ldl"] | 333 DEFINES = select({ |
| 334 CONDITION_ANDROID: DEFINES_ANDROID, |
| 335 "//conditions:default": DEFINES_UNIX, |
| 336 }) + DEFINES_ALL |
| 337 |
| 338 LINKOPTS = select({ |
| 339 CONDITION_ANDROID: [ |
| 340 "-ldl", |
| 341 "-lEGL", |
| 342 ], |
| 343 "//conditions:default": ["-ldl"], |
| 344 }) |
235 | 345 |
236 cc_library( | 346 cc_library( |
237 name = "opts_ssse3", | 347 name = "opts_ssse3", |
238 srcs = SRCS_SSSE3, | 348 srcs = SRCS_SSSE3, |
239 copts = COPTS + ["-mssse3"], | 349 copts = COPTS + ["-mssse3"], |
240 defines = DEFINES, | 350 defines = DEFINES, |
241 includes = INCLUDES, | 351 includes = INCLUDES, |
242 ) | 352 ) |
243 | 353 |
244 cc_library( | 354 cc_library( |
245 name = "opts_sse4", | 355 name = "opts_sse4", |
246 srcs = SRCS_SSE4, | 356 srcs = SRCS_SSE4, |
247 copts = COPTS + ["-msse4"], | 357 copts = COPTS + ["-msse4"], |
248 defines = DEFINES, | 358 defines = DEFINES, |
249 includes = INCLUDES, | 359 includes = INCLUDES, |
250 ) | 360 ) |
251 | 361 |
252 cc_library( | 362 cc_library( |
253 name = "skia", | 363 name = "skia", |
254 srcs = SRCS + PLATFORM_SRCS, | 364 srcs = SRCS + PLATFORM_SRCS, |
255 hdrs = HDRS, | 365 hdrs = HDRS, |
256 copts = COPTS, | 366 copts = COPTS, |
257 defines = DEFINES, | 367 defines = DEFINES, |
258 includes = INCLUDES, | 368 includes = INCLUDES, |
259 linkopts = LINKOPTS, | 369 linkopts = LINKOPTS, |
260 visibility = [":skia_clients"], | 370 visibility = [":skia_clients"], |
261 deps = EXTERNAL_DEPS + [ | 371 deps = DEPS, |
262 ":opts_sse4", | |
263 ":opts_ssse3", | |
264 ], | |
265 ) | 372 ) |
266 | 373 |
267 cc_test( | 374 cc_test( |
268 name = "dm", | 375 name = "dm", |
269 size = "large", | 376 size = "large", |
270 srcs = DM_SRCS, | 377 srcs = DM_SRCS + DM_PLATFORM_SRCS, |
271 args = [ | 378 args = [ |
272 "--nogpu", | 379 "--nogpu", |
273 "--verbose", | 380 "--verbose", |
274 # TODO(mtklein): maybe investigate why these fail? | 381 # TODO(mtklein): maybe investigate why these fail? |
275 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Code
c ~Stream ~skps ~Math", | 382 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Code
c ~Stream ~skps ~Math", |
276 "--resourcePath %s/resources" % BASE_DIR, | 383 "--resourcePath %s/resources" % BASE_DIR, |
277 "--images %s/resources" % BASE_DIR, | 384 "--images %s/resources" % BASE_DIR, |
278 ], | 385 ], |
279 copts = COPTS, | 386 copts = COPTS, |
280 data = glob(["resources/**/*"]), | 387 data = glob(["resources/**/*"]), |
281 defines = DEFINES, | 388 defines = DEFINES, |
282 includes = DM_INCLUDES, | 389 includes = DM_INCLUDES, |
283 deps = DM_EXTERNAL_DEPS + [ | 390 deps = DM_EXTERNAL_DEPS + [ |
284 ":skia", | 391 ":skia", |
285 ], | 392 ], |
286 ) | 393 ) |
OLD | NEW |