| OLD | NEW |
| (Empty) |
| 1 # Description: | |
| 2 # Skia graphics library. | |
| 3 # | |
| 4 # Definitions for Google BUILD file. | |
| 5 | |
| 6 exports_files(["BUILD.public"]) | |
| 7 | |
| 8 # All platform-independent SRCS. | |
| 9 BASE_SRCS = glob( | |
| 10 [ | |
| 11 "include/private/*.h", | |
| 12 "src/**/*.h", | |
| 13 "src/**/*.cpp", | |
| 14 | |
| 15 # Third Party | |
| 16 "third_party/etc1/*.cpp", | |
| 17 "third_party/etc1/*.h", | |
| 18 "third_party/ktx/*.cpp", | |
| 19 "third_party/ktx/*.h", | |
| 20 ], | |
| 21 exclude = [ | |
| 22 # Exclude platform-dependent files. | |
| 23 "src/codec/*", | |
| 24 "src/device/xps/*", # Windows-only. Move to ports? | |
| 25 "src/doc/*_XPS.cpp", # Windows-only. Move to ports? | |
| 26 "src/fonts/SkFontMgr_fontconfig.cpp", | |
| 27 "src/gpu/gl/android/*", | |
| 28 "src/gpu/gl/egl/*", | |
| 29 "src/gpu/gl/glx/*", | |
| 30 "src/gpu/gl/iOS/*", | |
| 31 "src/gpu/gl/mac/*", | |
| 32 "src/gpu/gl/win/*", | |
| 33 "src/images/*", | |
| 34 "src/opts/**/*", | |
| 35 "src/ports/**/*", | |
| 36 "src/utils/android/**/*", | |
| 37 "src/utils/mac/**/*", | |
| 38 "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? | |
| 39 "src/utils/win/**/*", | |
| 40 "src/views/sdl/*", | |
| 41 "src/views/win/*", | |
| 42 "src/views/unix/*", | |
| 43 | |
| 44 # Exclude multiple definitions. | |
| 45 # TODO(mtklein): Move to opts? | |
| 46 "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. | |
| 47 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", | |
| 48 "src/gpu/gl/GrGLDefaultInterface_native.cpp", | |
| 49 | |
| 50 # Exclude files that don't compile with the current DEFINES. | |
| 51 "src/gpu/gl/angle/*", # Requires SK_ANGLE define. | |
| 52 "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' | |
| 53 "src/gpu/gl/mesa/*", # Requires SK_MESA define. | |
| 54 "src/svg/parser/*", # Missing SkSVG.h. | |
| 55 | |
| 56 # Conflicting dependencies among Lua versions. See cl/107087297. | |
| 57 "src/utils/SkLua*", | |
| 58 | |
| 59 # Not used. | |
| 60 "src/animator/**/*", | |
| 61 "src/views/**/*", | |
| 62 "src/xml/SkBML_Verbs.h", | |
| 63 "src/xml/SkBML_XMLParser.cpp", | |
| 64 "src/xml/SkXMLPullParser.cpp", | |
| 65 ], | |
| 66 ) | |
| 67 | |
| 68 # Platform-dependent SRCS for google3-default platform. | |
| 69 BASE_SRCS_UNIX = glob( | |
| 70 [ | |
| 71 "src/codec/*", | |
| 72 "src/fonts/SkFontMgr_fontconfig.cpp", | |
| 73 "src/images/*", | |
| 74 "src/opts/**/*.cpp", | |
| 75 "src/opts/**/*.h", | |
| 76 "src/ports/**/*.cpp", | |
| 77 "src/ports/**/*.h", | |
| 78 ], | |
| 79 exclude = [ | |
| 80 "src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch. | |
| 81 "src/opts/*arm*", | |
| 82 "src/opts/*mips*", | |
| 83 "src/opts/*NEON*", | |
| 84 "src/opts/*neon*", | |
| 85 # Included in :opts_ssse3 library. | |
| 86 "src/opts/*SSSE3*", | |
| 87 "src/opts/*ssse3*", | |
| 88 # Included in :opts_sse4 library. | |
| 89 "src/opts/*SSE4*", | |
| 90 "src/opts/*sse4*", | |
| 91 # Included in :opts_avx or :opts_avx2 | |
| 92 "src/opts/*avx*", | |
| 93 "src/opts/SkBitmapProcState_opts_none.cpp", | |
| 94 "src/opts/SkBlitMask_opts_none.cpp", | |
| 95 "src/opts/SkBlitRow_opts_none.cpp", | |
| 96 "src/ports/*android*", | |
| 97 "src/ports/*chromium*", | |
| 98 "src/ports/*mac*", | |
| 99 "src/ports/*mozalloc*", | |
| 100 "src/ports/*nacl*", | |
| 101 "src/ports/*win*", | |
| 102 "src/ports/SkFontConfigInterface_direct_factory.cpp", | |
| 103 "src/ports/SkFontMgr_custom_directory_factory.cpp", | |
| 104 "src/ports/SkFontMgr_custom_embedded_factory.cpp", | |
| 105 "src/ports/SkFontMgr_empty_factory.cpp", | |
| 106 "src/ports/SkFontMgr_fontconfig.cpp", | |
| 107 "src/ports/SkImageDecoder_CG.cpp", | |
| 108 "src/ports/SkFontMgr_fontconfig_factory.cpp", | |
| 109 "src/ports/SkImageDecoder_WIC.cpp", | |
| 110 "src/ports/SkImageDecoder_empty.cpp", | |
| 111 "src/ports/SkImageGenerator_none.cpp", | |
| 112 "src/ports/SkTLS_none.cpp", | |
| 113 ], | |
| 114 ) | |
| 115 | |
| 116 # Platform-dependent SRCS for google3-default Android. | |
| 117 BASE_SRCS_ANDROID = glob( | |
| 118 [ | |
| 119 "src/codec/*", | |
| 120 "src/images/*", | |
| 121 # TODO(benjaminwagner): Figure out how to compile with EGL. | |
| 122 "src/opts/**/*.cpp", | |
| 123 "src/opts/**/*.h", | |
| 124 "src/ports/**/*.cpp", | |
| 125 "src/ports/**/*.h", | |
| 126 ], | |
| 127 exclude = [ | |
| 128 "src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch. | |
| 129 "src/opts/*mips*", | |
| 130 "src/opts/*SSE2*", | |
| 131 "src/opts/*SSSE3*", | |
| 132 "src/opts/*ssse3*", | |
| 133 "src/opts/*SSE4*", | |
| 134 "src/opts/*sse4*", | |
| 135 "src/opts/*avx*", | |
| 136 "src/opts/*x86*", | |
| 137 "src/opts/SkBitmapProcState_opts_none.cpp", | |
| 138 "src/opts/SkBlitMask_opts_none.cpp", | |
| 139 "src/opts/SkBlitRow_opts_none.cpp", | |
| 140 "src/ports/*chromium*", | |
| 141 "src/ports/*fontconfig*", | |
| 142 "src/ports/*FontConfig*", | |
| 143 "src/ports/*mac*", | |
| 144 "src/ports/*mozalloc*", | |
| 145 "src/ports/*nacl*", | |
| 146 "src/ports/*win*", | |
| 147 "src/ports/SkDebug_stdio.cpp", | |
| 148 "src/ports/SkFontConfigInterface_direct_factory.cpp", | |
| 149 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", | |
| 150 "src/ports/SkFontMgr_custom_directory_factory.cpp", | |
| 151 "src/ports/SkFontMgr_custom_embedded_factory.cpp", | |
| 152 "src/ports/SkFontMgr_empty_factory.cpp", | |
| 153 "src/ports/SkImageDecoder_CG.cpp", | |
| 154 "src/ports/SkImageDecoder_WIC.cpp", | |
| 155 "src/ports/SkImageDecoder_empty.cpp", | |
| 156 "src/ports/SkImageGenerator_none.cpp", | |
| 157 "src/ports/SkTLS_none.cpp", | |
| 158 ], | |
| 159 ) | |
| 160 | |
| 161 # Platform-dependent SRCS for google3-default iOS. | |
| 162 BASE_SRCS_IOS = glob( | |
| 163 [ | |
| 164 "src/opts/**/*.cpp", | |
| 165 "src/opts/**/*.h", | |
| 166 "src/ports/**/*.cpp", | |
| 167 "src/ports/**/*.h", | |
| 168 ], | |
| 169 exclude = [ | |
| 170 "src/opts/*mips*", | |
| 171 "src/opts/*NEON*", | |
| 172 "src/opts/*neon*", | |
| 173 "src/opts/*SSE2*", | |
| 174 "src/opts/*SSSE3*", | |
| 175 "src/opts/*ssse3*", | |
| 176 "src/opts/*SSE4*", | |
| 177 "src/opts/*sse4*", | |
| 178 "src/opts/*avx*", | |
| 179 "src/opts/*x86*", | |
| 180 "src/opts/SkBitmapProcState_opts_none.cpp", | |
| 181 "src/opts/SkBlitMask_opts_none.cpp", | |
| 182 "src/opts/SkBlitRow_opts_none.cpp", | |
| 183 "src/ports/*android*", | |
| 184 "src/ports/*chromium*", | |
| 185 "src/ports/*fontconfig*", | |
| 186 "src/ports/*FontConfig*", | |
| 187 "src/ports/*FreeType*", | |
| 188 "src/ports/*mozalloc*", | |
| 189 "src/ports/*nacl*", | |
| 190 "src/ports/*win*", | |
| 191 "src/ports/SkDebug_stdio.cpp", | |
| 192 "src/ports/SkFontMgr_custom.cpp", | |
| 193 "src/ports/SkFontConfigInterface_direct_factory.cpp", | |
| 194 "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", | |
| 195 "src/ports/SkFontMgr_custom_directory_factory.cpp", | |
| 196 "src/ports/SkFontMgr_custom_embedded_factory.cpp", | |
| 197 "src/ports/SkFontMgr_empty_factory.cpp", | |
| 198 "src/ports/SkImageDecoder_CG.cpp", | |
| 199 "src/ports/SkImageDecoder_WIC.cpp", | |
| 200 "src/ports/SkImageDecoder_empty.cpp", | |
| 201 "src/ports/SkImageGenerator_none.cpp", | |
| 202 "src/ports/SkTLS_none.cpp", | |
| 203 ], | |
| 204 ) | |
| 205 | |
| 206 BASE_SRCS_PLATFORM = select({ | |
| 207 CONDITION_ANDROID: BASE_SRCS_ANDROID, | |
| 208 CONDITION_IOS: BASE_SRCS_IOS, | |
| 209 "//conditions:default": BASE_SRCS_UNIX, | |
| 210 }) | |
| 211 | |
| 212 SSSE3_SRCS = glob( | |
| 213 [ | |
| 214 "src/opts/*SSSE3*.cpp", | |
| 215 "src/opts/*ssse3*.cpp", | |
| 216 ], | |
| 217 ) | |
| 218 | |
| 219 SSE4_SRCS = glob( | |
| 220 [ | |
| 221 "src/opts/*SSE4*.cpp", | |
| 222 "src/opts/*sse4*.cpp", | |
| 223 ], | |
| 224 ) | |
| 225 | |
| 226 AVX_SRCS = glob( | |
| 227 [ | |
| 228 "src/opts/*_avx.cpp", | |
| 229 ], | |
| 230 ) | |
| 231 | |
| 232 AVX2_SRCS = glob( | |
| 233 [ | |
| 234 "src/opts/*_avx2.cpp", | |
| 235 ], | |
| 236 ) | |
| 237 | |
| 238 BASE_HDRS = glob( | |
| 239 [ | |
| 240 "include/**/*.h", | |
| 241 ], | |
| 242 exclude = [ | |
| 243 "include/private/**/*", | |
| 244 | |
| 245 # Not used. | |
| 246 "include/animator/**/*", | |
| 247 "include/views/**/*", | |
| 248 "include/xml/SkBML_WXMLParser.h", | |
| 249 "include/xml/SkBML_XMLParser.h", | |
| 250 ], | |
| 251 ) | |
| 252 | |
| 253 # Dependencies. | |
| 254 BASE_DEPS_UNIX = [ | |
| 255 ":opts_avx2", | |
| 256 ":opts_avx", | |
| 257 ":opts_sse4", | |
| 258 ":opts_ssse3", | |
| 259 ] | |
| 260 | |
| 261 BASE_DEPS_ANDROID = [] | |
| 262 | |
| 263 BASE_DEPS_IOS = [] | |
| 264 | |
| 265 BASE_DEPS = select({ | |
| 266 CONDITION_ANDROID: BASE_DEPS_ANDROID + BASE_EXTERNAL_DEPS_ANDROID, | |
| 267 CONDITION_IOS: BASE_DEPS_IOS + BASE_EXTERNAL_DEPS_IOS, | |
| 268 "//conditions:default": BASE_DEPS_UNIX + BASE_EXTERNAL_DEPS_UNIX, | |
| 269 }) + EXTERNAL_DEPS_ALL | |
| 270 | |
| 271 # Includes needed by Skia implementation. Not public includes. | |
| 272 INCLUDES = [ | |
| 273 "include/android", | |
| 274 "include/c", | |
| 275 "include/codec", | |
| 276 "include/config", | |
| 277 "include/core", | |
| 278 "include/effects", | |
| 279 "include/gpu", | |
| 280 "include/images", | |
| 281 "include/pathops", | |
| 282 "include/pipe", | |
| 283 "include/ports", | |
| 284 "include/private", | |
| 285 "include/utils", | |
| 286 "include/utils/mac", | |
| 287 "include/utils/win", | |
| 288 "include/svg", | |
| 289 "include/xml", | |
| 290 "src/codec", | |
| 291 "src/core", | |
| 292 "src/gpu", | |
| 293 "src/image", | |
| 294 "src/lazy", | |
| 295 "src/opts", | |
| 296 "src/ports", | |
| 297 "src/pdf", | |
| 298 "src/sfnt", | |
| 299 "src/utils", | |
| 300 "third_party/etc1", | |
| 301 "third_party/ktx", | |
| 302 ] + EXTERNAL_INCLUDES | |
| 303 | |
| 304 ## :dm | |
| 305 | |
| 306 # Platform-independent SRCS for DM. | |
| 307 DM_SRCS = glob( | |
| 308 [ | |
| 309 "dm/*.cpp", | |
| 310 "dm/*.h", | |
| 311 "gm/*.c", | |
| 312 "gm/*.cpp", | |
| 313 "gm/*.h", | |
| 314 "tests/*.cpp", | |
| 315 "tests/*.h", | |
| 316 "tools/CrashHandler.cpp", | |
| 317 "tools/CrashHandler.h", | |
| 318 "tools/LazyDecodeBitmap.cpp", | |
| 319 "tools/LazyDecodeBitmap.h", | |
| 320 "tools/ProcStats.cpp", | |
| 321 "tools/ProcStats.h", | |
| 322 "tools/Resources.cpp", | |
| 323 "tools/Resources.h", | |
| 324 "tools/SkBitmapRegionCanvas.cpp", | |
| 325 "tools/SkBitmapRegionCanvas.h", | |
| 326 "tools/SkBitmapRegionCodec.cpp", | |
| 327 "tools/SkBitmapRegionCodec.h", | |
| 328 "tools/SkBitmapRegionDecoder.cpp", | |
| 329 "tools/SkBitmapRegionDecoder.h", | |
| 330 "tools/SkBitmapRegionSampler.cpp", | |
| 331 "tools/SkBitmapRegionSampler.h", | |
| 332 "tools/flags/*.cpp", | |
| 333 "tools/flags/*.h", | |
| 334 "tools/sk_tool_utils.cpp", | |
| 335 "tools/sk_tool_utils.h", | |
| 336 "tools/sk_tool_utils_font.cpp", | |
| 337 "tools/timer/*.cpp", | |
| 338 "tools/timer/*.h", | |
| 339 ], | |
| 340 exclude = [ | |
| 341 "dm/DMSrcSinkAndroid.cpp", # Android-only. | |
| 342 "tests/FontMgrAndroidParserTest.cpp", # Android-only. | |
| 343 "tests/PathOpsSkpClipTest.cpp", # Alternate main. | |
| 344 "tests/skia_test.cpp", # Old main. | |
| 345 "tests/SkpSkGrTest.cpp", # Alternate main. | |
| 346 "tools/timer/SysTimer_mach.cpp", | |
| 347 "tools/timer/SysTimer_windows.cpp", | |
| 348 ], | |
| 349 ) | |
| 350 | |
| 351 DM_SRCS_UNIX = [] | |
| 352 | |
| 353 DM_SRCS_ANDROID = glob( | |
| 354 [ | |
| 355 # Depends on Android HWUI library that is not available in google3. | |
| 356 #"dm/DMSrcSinkAndroid.cpp", | |
| 357 "tests/FontMgrAndroidParserTest.cpp", | |
| 358 ], | |
| 359 ) | |
| 360 | |
| 361 DM_PLATFORM_SRCS = select({ | |
| 362 CONDITION_ANDROID: DM_SRCS_ANDROID, | |
| 363 "//conditions:default": DM_SRCS_UNIX, | |
| 364 }) | |
| 365 | |
| 366 DM_INCLUDES = [ | |
| 367 "gm", | |
| 368 "src/codec", | |
| 369 "src/effects", | |
| 370 "src/fonts", | |
| 371 "src/pathops", | |
| 372 "src/pipe/utils", | |
| 373 "src/ports", | |
| 374 "src/utils/debugger", | |
| 375 "tests", | |
| 376 "tools", | |
| 377 "tools/flags", | |
| 378 "tools/timer", | |
| 379 ] | |
| 380 | |
| 381 COPTS_ANDROID = ["-mfpu=neon"] | |
| 382 | |
| 383 COPTS_IOS = [] | |
| 384 | |
| 385 COPTS_UNIX = [ | |
| 386 "-Wno-implicit-fallthrough", # Some intentional fallthrough. | |
| 387 "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( | |
| 388 ] | |
| 389 | |
| 390 COPTS = select({ | |
| 391 CONDITION_ANDROID: COPTS_ANDROID, | |
| 392 CONDITION_IOS: COPTS_IOS, | |
| 393 "//conditions:default": COPTS_UNIX, | |
| 394 }) | |
| 395 | |
| 396 DEFINES_ANDROID = [ | |
| 397 "SK_BUILD_FOR_ANDROID", | |
| 398 # TODO(benjaminwagner): Try to get png library updated? | |
| 399 "SK_PNG_NO_INDEX_SUPPORTED", | |
| 400 ] | |
| 401 | |
| 402 DEFINES_IOS = [ | |
| 403 "SK_BUILD_FOR_IOS", | |
| 404 "SK_IGNORE_ETC1_SUPPORT", | |
| 405 ] | |
| 406 | |
| 407 DEFINES_UNIX = [ | |
| 408 "SK_BUILD_FOR_UNIX", | |
| 409 "SK_SAMPLES_FOR_X", | |
| 410 "SK_SFNTLY_SUBSETTER", | |
| 411 ] | |
| 412 | |
| 413 DEFINES_ALL = [ | |
| 414 # Chrome DEFINES. | |
| 415 "SK_USE_FLOATBITS", | |
| 416 "SK_USE_FREETYPE_EMBOLDEN", | |
| 417 # Turn on a few Google3-specific build fixes. | |
| 418 "GOOGLE3", | |
| 419 ] | |
| 420 | |
| 421 DEFINES = select({ | |
| 422 CONDITION_ANDROID: DEFINES_ANDROID, | |
| 423 CONDITION_IOS: DEFINES_IOS, | |
| 424 "//conditions:default": DEFINES_UNIX, | |
| 425 }) + DEFINES_ALL | |
| 426 | |
| 427 LINKOPTS = select({ | |
| 428 CONDITION_ANDROID: [ | |
| 429 "-ldl", | |
| 430 "-lEGL", | |
| 431 ], | |
| 432 "//conditions:default": ["-ldl"], | |
| 433 }) | |
| 434 | |
| 435 cc_library( | |
| 436 name = "opts_ssse3", | |
| 437 srcs = SSSE3_SRCS, | |
| 438 copts = COPTS + ["-mssse3"], | |
| 439 defines = DEFINES, | |
| 440 includes = INCLUDES, | |
| 441 deps = EXTERNAL_DEPS_ALL, | |
| 442 ) | |
| 443 | |
| 444 cc_library( | |
| 445 name = "opts_sse4", | |
| 446 srcs = SSE4_SRCS, | |
| 447 copts = COPTS + ["-msse4"], | |
| 448 defines = DEFINES, | |
| 449 includes = INCLUDES, | |
| 450 deps = EXTERNAL_DEPS_ALL, | |
| 451 ) | |
| 452 | |
| 453 cc_library( | |
| 454 name = "opts_avx", | |
| 455 srcs = AVX_SRCS, | |
| 456 copts = COPTS + ["-mavx"], | |
| 457 defines = DEFINES, | |
| 458 includes = INCLUDES, | |
| 459 deps = EXTERNAL_DEPS_ALL, | |
| 460 ) | |
| 461 | |
| 462 cc_library( | |
| 463 name = "opts_avx2", | |
| 464 srcs = AVX2_SRCS, | |
| 465 copts = COPTS + ["-mavx2"], | |
| 466 defines = DEFINES, | |
| 467 includes = INCLUDES, | |
| 468 deps = EXTERNAL_DEPS_ALL, | |
| 469 ) | |
| 470 | |
| 471 # If you need Ganesh (GPU) support in Skia, please contact skia-team@google.com | |
| 472 # for help. | |
| 473 cc_library( | |
| 474 name = "skia", | |
| 475 srcs = BASE_SRCS + BASE_SRCS_PLATFORM, | |
| 476 hdrs = BASE_HDRS, | |
| 477 copts = COPTS, | |
| 478 defines = DEFINES, | |
| 479 includes = INCLUDES, | |
| 480 linkopts = LINKOPTS, | |
| 481 visibility = [":skia_clients"], | |
| 482 deps = BASE_DEPS, | |
| 483 alwayslink = 1, | |
| 484 ) | |
| 485 | |
| 486 cc_test( | |
| 487 name = "dm", | |
| 488 size = "large", | |
| 489 srcs = DM_SRCS + DM_PLATFORM_SRCS, | |
| 490 args = [ | |
| 491 "--nogpu", | |
| 492 "--verbose", | |
| 493 # TODO(mtklein): maybe investigate why these fail? | |
| 494 "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Code
c ~Stream ~skps ~RecordDraw_TextBounds", | |
| 495 "--resourcePath %s/resources" % BASE_DIR, | |
| 496 "--images %s/resources" % BASE_DIR, | |
| 497 ], | |
| 498 copts = COPTS, | |
| 499 data = glob(["resources/**/*"]), | |
| 500 defines = DEFINES, | |
| 501 includes = DM_INCLUDES, | |
| 502 deps = DM_EXTERNAL_DEPS + [ | |
| 503 ":skia", | |
| 504 ] + EXTERNAL_DEPS_ALL, | |
| 505 ) | |
| OLD | NEW |