2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
# Skylark macros
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
is_bazel = not hasattr(native, "genmpm")
|
|
|
|
|
|
|
|
def portable_select(select_dict, bazel_condition, default_condition):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""Replaces select() with a Bazel-friendly wrapper.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
select_dict: Dictionary in the same format as select().
|
|
|
|
Returns:
|
|
|
|
If Blaze platform, returns select() using select_dict.
|
|
|
|
If Bazel platform, returns dependencies for condition
|
|
|
|
bazel_condition, or empty list if none specified.
|
|
|
|
"""
|
|
|
|
if is_bazel:
|
|
|
|
return select_dict.get(bazel_condition, select_dict[default_condition])
|
|
|
|
else:
|
|
|
|
return select(select_dict)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
def skia_select(conditions, results):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""Replaces select() for conditions [UNIX, ANDROID, IOS]
|
|
|
|
|
|
|
|
Args:
|
|
|
|
conditions: [CONDITION_UNIX, CONDITION_ANDROID, CONDITION_IOS]
|
|
|
|
results: [RESULT_UNIX, RESULT_ANDROID, RESULT_IOS]
|
|
|
|
Returns:
|
|
|
|
The result matching the platform condition.
|
|
|
|
"""
|
|
|
|
if len(conditions) != 3 or len(results) != 3:
|
|
|
|
fail("Must provide exactly 3 conditions and 3 results")
|
|
|
|
|
|
|
|
selector = {}
|
|
|
|
for i in range(3):
|
|
|
|
selector[conditions[i]] = results[i]
|
|
|
|
return portable_select(selector, conditions[2], conditions[0])
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
def skia_glob(srcs):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""Replaces glob() with a version that accepts a struct.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
srcs: struct(include=[], exclude=[])
|
|
|
|
Returns:
|
|
|
|
Equivalent of glob(srcs.include, exclude=srcs.exclude)
|
|
|
|
"""
|
|
|
|
if hasattr(srcs, "include"):
|
|
|
|
if hasattr(srcs, "exclude"):
|
|
|
|
return native.glob(srcs.include, exclude = srcs.exclude)
|
|
|
|
else:
|
|
|
|
return native.glob(srcs.include)
|
|
|
|
return []
|
2016-01-13 18:45:19 +00:00
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
################################################################################
|
|
|
|
## skia_{all,public}_hdrs()
|
|
|
|
################################################################################
|
|
|
|
def skia_all_hdrs():
|
2018-07-31 14:31:06 +00:00
|
|
|
return native.glob([
|
|
|
|
"src/**/*.h",
|
|
|
|
"include/**/*.h",
|
|
|
|
"third_party/**/*.h",
|
|
|
|
])
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
def skia_public_hdrs():
|
2018-07-31 14:31:06 +00:00
|
|
|
return native.glob(
|
|
|
|
["include/**/*.h"],
|
|
|
|
exclude = [
|
|
|
|
"include/private/**/*",
|
|
|
|
],
|
|
|
|
)
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## skia_opts_srcs()
|
|
|
|
################################################################################
|
|
|
|
# Intel
|
|
|
|
SKIA_OPTS_SSE2 = "SSE2"
|
|
|
|
|
|
|
|
SKIA_OPTS_SSSE3 = "SSSE3"
|
|
|
|
|
|
|
|
SKIA_OPTS_SSE41 = "SSE41"
|
|
|
|
|
|
|
|
SKIA_OPTS_SSE42 = "SSE42"
|
|
|
|
|
|
|
|
SKIA_OPTS_AVX = "AVX"
|
|
|
|
|
2018-02-27 18:43:53 +00:00
|
|
|
SKIA_OPTS_HSW = "HSW"
|
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
# Arm
|
|
|
|
SKIA_OPTS_NEON = "NEON"
|
|
|
|
|
|
|
|
SKIA_OPTS_CRC32 = "CRC32" # arm64
|
|
|
|
|
|
|
|
def opts_srcs(opts):
|
2018-07-31 14:31:06 +00:00
|
|
|
if opts == SKIA_OPTS_SSE2:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_SSE2.cpp",
|
|
|
|
"src/opts/*_sse2.cpp", # No matches currently.
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_SSSE3:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_SSSE3.cpp",
|
|
|
|
"src/opts/*_ssse3.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_SSE41:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_sse41.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_SSE42:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_sse42.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_AVX:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_avx.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_HSW:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_hsw.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_NEON:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_neon.cpp",
|
|
|
|
])
|
|
|
|
elif opts == SKIA_OPTS_CRC32:
|
|
|
|
return native.glob([
|
|
|
|
"src/opts/*_crc32.cpp",
|
|
|
|
])
|
|
|
|
else:
|
|
|
|
fail("skia_opts_srcs parameter 'opts' must be one of SKIA_OPTS_*.")
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
def opts_cflags(opts):
|
2018-07-31 14:31:06 +00:00
|
|
|
if opts == SKIA_OPTS_SSE2:
|
|
|
|
return ["-msse2"]
|
|
|
|
elif opts == SKIA_OPTS_SSSE3:
|
|
|
|
return ["-mssse3"]
|
|
|
|
elif opts == SKIA_OPTS_SSE41:
|
|
|
|
return ["-msse4.1"]
|
|
|
|
elif opts == SKIA_OPTS_SSE42:
|
|
|
|
return ["-msse4.2"]
|
|
|
|
elif opts == SKIA_OPTS_AVX:
|
|
|
|
return ["-mavx"]
|
|
|
|
elif opts == SKIA_OPTS_HSW:
|
|
|
|
return ["-mavx2", "-mf16c", "-mfma"]
|
|
|
|
elif opts == SKIA_OPTS_NEON:
|
|
|
|
return ["-mfpu=neon"]
|
|
|
|
elif opts == SKIA_OPTS_CRC32:
|
|
|
|
# NDK r11's Clang (3.8) doesn't pass along this -march setting correctly to an external
|
|
|
|
# assembler, so we do it manually with -Wa. This is just a bug, fixed in later Clangs.
|
|
|
|
return ["-march=armv8-a+crc", "-Wa,-march=armv8-a+crc"]
|
|
|
|
else:
|
|
|
|
return []
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
SKIA_CPU_ARM = "ARM"
|
|
|
|
|
|
|
|
SKIA_CPU_ARM64 = "ARM64"
|
|
|
|
|
|
|
|
SKIA_CPU_X86 = "X86"
|
|
|
|
|
|
|
|
SKIA_CPU_OTHER = "OTHER"
|
|
|
|
|
|
|
|
def opts_rest_srcs(cpu):
|
2018-07-31 14:31:06 +00:00
|
|
|
srcs = []
|
|
|
|
if cpu == SKIA_CPU_ARM or cpu == SKIA_CPU_ARM64:
|
|
|
|
srcs += native.glob([
|
|
|
|
"src/opts/*_arm.cpp",
|
|
|
|
"src/opts/SkBitmapProcState_opts_none.cpp",
|
|
|
|
])
|
|
|
|
if cpu == SKIA_CPU_ARM64:
|
|
|
|
# NEON doesn't need special flags to compile on ARM64.
|
|
|
|
srcs += native.glob([
|
|
|
|
"src/opts/*_neon.cpp",
|
|
|
|
])
|
|
|
|
elif cpu == SKIA_CPU_X86:
|
|
|
|
srcs += native.glob([
|
|
|
|
"src/opts/*_x86.cpp",
|
|
|
|
])
|
|
|
|
elif cpu == SKIA_CPU_OTHER:
|
|
|
|
srcs += native.glob([
|
|
|
|
"src/opts/*_none.cpp",
|
|
|
|
])
|
|
|
|
else:
|
|
|
|
fail("opts_rest_srcs parameter 'cpu' must be one of " +
|
|
|
|
"SKIA_CPU_{ARM,ARM64,X86,OTHER}.")
|
|
|
|
return srcs
|
2017-10-17 14:57:34 +00:00
|
|
|
|
|
|
|
def skia_opts_deps(cpu):
|
2018-07-31 14:31:06 +00:00
|
|
|
res = [":opts_rest"]
|
2017-10-17 14:57:34 +00:00
|
|
|
|
2018-07-31 14:31:06 +00:00
|
|
|
if cpu == SKIA_CPU_ARM:
|
|
|
|
res += [":opts_neon"]
|
2017-10-17 14:57:34 +00:00
|
|
|
|
2018-07-31 14:31:06 +00:00
|
|
|
if cpu == SKIA_CPU_ARM64:
|
|
|
|
res += [":opts_crc32"]
|
2017-10-24 15:40:41 +00:00
|
|
|
|
2018-07-31 14:31:06 +00:00
|
|
|
if cpu == SKIA_CPU_X86:
|
|
|
|
res += [
|
|
|
|
":opts_sse2",
|
|
|
|
":opts_ssse3",
|
|
|
|
":opts_sse41",
|
|
|
|
":opts_sse42",
|
|
|
|
":opts_avx",
|
|
|
|
":opts_hsw",
|
|
|
|
]
|
2017-10-17 14:57:34 +00:00
|
|
|
|
2018-07-31 14:31:06 +00:00
|
|
|
return res
|
2017-10-17 14:57:34 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## BASE_SRCS
|
|
|
|
################################################################################
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2015-11-18 21:26:10 +00:00
|
|
|
# All platform-independent SRCS.
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_SRCS_ALL = struct(
|
|
|
|
include = [
|
2017-03-16 23:15:09 +00:00
|
|
|
"include/private/**/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/**/*.h",
|
|
|
|
"src/**/*.cpp",
|
2017-03-16 23:15:09 +00:00
|
|
|
"src/**/*.inc",
|
2017-03-29 21:32:50 +00:00
|
|
|
"src/jumper/SkJumper_generated.S",
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2015-08-18 15:51:49 +00:00
|
|
|
# Third Party
|
2016-10-24 18:11:12 +00:00
|
|
|
"third_party/gif/*.cpp",
|
|
|
|
"third_party/gif/*.h",
|
2015-08-17 19:58:10 +00:00
|
|
|
],
|
2017-03-16 23:15:09 +00:00
|
|
|
exclude = [
|
2015-10-15 15:09:44 +00:00
|
|
|
# Exclude platform-dependent files.
|
2016-01-07 15:11:39 +00:00
|
|
|
"src/codec/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/device/xps/*", # Windows-only. Move to ports?
|
|
|
|
"src/doc/*_XPS.cpp", # Windows-only. Move to ports?
|
|
|
|
"src/gpu/gl/android/*",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/gpu/gl/egl/*",
|
2016-03-28 20:27:28 +00:00
|
|
|
"src/gpu/gl/glfw/*",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/gpu/gl/glx/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/gpu/gl/iOS/*",
|
|
|
|
"src/gpu/gl/mac/*",
|
|
|
|
"src/gpu/gl/win/*",
|
|
|
|
"src/opts/**/*",
|
|
|
|
"src/ports/**/*",
|
|
|
|
"src/utils/android/**/*",
|
|
|
|
"src/utils/mac/**/*",
|
|
|
|
"src/utils/win/**/*",
|
|
|
|
|
|
|
|
# Exclude multiple definitions.
|
|
|
|
# TODO(mtklein): Move to opts?
|
2016-03-14 22:21:12 +00:00
|
|
|
"src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp.
|
2017-12-11 15:06:31 +00:00
|
|
|
"src/gpu/gl/GrGLMakeNativeInterface_none.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
|
2018-03-26 19:46:40 +00:00
|
|
|
# Exclude files that don't compile everywhere.
|
|
|
|
"src/svg/**/*", # Depends on xml, SkJpegCodec, and SkPngCodec.
|
|
|
|
"src/xml/**/*", # Avoid dragging in expat when not needed.
|
2015-10-15 15:09:44 +00:00
|
|
|
|
2015-11-18 21:26:10 +00:00
|
|
|
# Conflicting dependencies among Lua versions. See cl/107087297.
|
|
|
|
"src/utils/SkLua*",
|
|
|
|
|
2016-02-22 18:07:54 +00:00
|
|
|
# Currently exclude all vulkan specific files
|
|
|
|
"src/gpu/vk/*",
|
2016-09-30 19:06:27 +00:00
|
|
|
|
|
|
|
# Defines main.
|
|
|
|
"src/sksl/SkSLMain.cpp",
|
2017-09-07 15:07:42 +00:00
|
|
|
|
|
|
|
# Only used to regenerate the lexer
|
|
|
|
"src/sksl/lex/*",
|
2017-11-19 18:20:13 +00:00
|
|
|
|
|
|
|
# Atlas text
|
|
|
|
"src/atlastext/*",
|
2018-03-27 17:22:50 +00:00
|
|
|
|
|
|
|
# Not time for skcms in Google3 yet.
|
|
|
|
"src/core/SkColorSpaceXform_skcms.cpp",
|
2018-06-20 13:44:59 +00:00
|
|
|
|
|
|
|
# Compute backend not yet even hooked into Skia.
|
2018-07-31 14:31:06 +00:00
|
|
|
"src/compute/**/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def codec_srcs(limited):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""Sources for the codecs. Excludes Ico, Webp, Png, and Raw if limited."""
|
|
|
|
exclude = []
|
|
|
|
if limited:
|
|
|
|
exclude += [
|
|
|
|
"src/codec/*Ico*.cpp",
|
|
|
|
"src/codec/*Webp*.cpp",
|
|
|
|
"src/codec/*Png*",
|
|
|
|
"src/codec/*Raw*.cpp",
|
|
|
|
]
|
|
|
|
return native.glob(["src/codec/*.cpp"], exclude = exclude)
|
2017-10-17 14:57:34 +00:00
|
|
|
|
2015-10-15 15:09:44 +00:00
|
|
|
# Platform-dependent SRCS for google3-default platform.
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_SRCS_UNIX = struct(
|
|
|
|
include = [
|
2017-12-11 20:21:39 +00:00
|
|
|
"src/gpu/gl/GrGLMakeNativeInterface_none.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/**/*.cpp",
|
|
|
|
"src/ports/**/*.h",
|
|
|
|
],
|
|
|
|
exclude = [
|
2016-03-10 15:15:59 +00:00
|
|
|
"src/ports/*CG*",
|
2016-03-17 20:50:17 +00:00
|
|
|
"src/ports/*WIC*",
|
2016-03-10 16:52:05 +00:00
|
|
|
"src/ports/*android*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/*chromium*",
|
|
|
|
"src/ports/*mac*",
|
|
|
|
"src/ports/*mozalloc*",
|
|
|
|
"src/ports/*nacl*",
|
|
|
|
"src/ports/*win*",
|
2015-12-01 19:12:05 +00:00
|
|
|
"src/ports/SkFontMgr_custom_directory_factory.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
|
2016-03-21 17:45:01 +00:00
|
|
|
"src/ports/SkFontMgr_custom_empty_factory.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/SkFontMgr_empty_factory.cpp",
|
2015-12-03 13:04:03 +00:00
|
|
|
"src/ports/SkFontMgr_fontconfig.cpp",
|
2015-12-01 19:12:05 +00:00
|
|
|
"src/ports/SkFontMgr_fontconfig_factory.cpp",
|
2017-02-09 20:28:53 +00:00
|
|
|
"src/ports/SkGlobalInitialization_none.cpp",
|
2018-06-20 13:34:05 +00:00
|
|
|
"src/ports/SkGlobalInitialization_none_imagefilters.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/ports/SkImageGenerator_none.cpp",
|
|
|
|
"src/ports/SkTLS_none.cpp",
|
2015-08-18 15:51:49 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2015-10-26 17:46:25 +00:00
|
|
|
# Platform-dependent SRCS for google3-default Android.
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_SRCS_ANDROID = struct(
|
|
|
|
include = [
|
2017-12-11 20:21:39 +00:00
|
|
|
"src/gpu/gl/GrGLMakeNativeInterface_none.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
# TODO(benjaminwagner): Figure out how to compile with EGL.
|
|
|
|
"src/ports/**/*.cpp",
|
|
|
|
"src/ports/**/*.h",
|
|
|
|
],
|
|
|
|
exclude = [
|
2016-03-10 15:15:59 +00:00
|
|
|
"src/ports/*CG*",
|
2016-03-10 16:52:05 +00:00
|
|
|
"src/ports/*FontConfig*",
|
2016-03-17 20:50:17 +00:00
|
|
|
"src/ports/*WIC*",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports/*chromium*",
|
|
|
|
"src/ports/*fontconfig*",
|
|
|
|
"src/ports/*mac*",
|
|
|
|
"src/ports/*mozalloc*",
|
|
|
|
"src/ports/*nacl*",
|
|
|
|
"src/ports/*win*",
|
|
|
|
"src/ports/SkDebug_stdio.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_directory_factory.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
|
2016-03-21 17:45:01 +00:00
|
|
|
"src/ports/SkFontMgr_custom_empty_factory.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports/SkFontMgr_empty_factory.cpp",
|
2017-02-09 20:28:53 +00:00
|
|
|
"src/ports/SkGlobalInitialization_none.cpp",
|
2018-06-20 13:34:05 +00:00
|
|
|
"src/ports/SkGlobalInitialization_none_imagefilters.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports/SkImageGenerator_none.cpp",
|
|
|
|
"src/ports/SkTLS_none.cpp",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2015-11-02 19:11:21 +00:00
|
|
|
# Platform-dependent SRCS for google3-default iOS.
|
2016-01-13 18:45:19 +00:00
|
|
|
BASE_SRCS_IOS = struct(
|
|
|
|
include = [
|
2017-12-11 15:06:31 +00:00
|
|
|
"src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/ports/**/*.cpp",
|
|
|
|
"src/ports/**/*.h",
|
2016-02-17 03:17:01 +00:00
|
|
|
"src/utils/mac/*.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
],
|
|
|
|
exclude = [
|
2016-03-10 16:52:05 +00:00
|
|
|
"src/ports/*FontConfig*",
|
|
|
|
"src/ports/*FreeType*",
|
2016-03-17 20:50:17 +00:00
|
|
|
"src/ports/*WIC*",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/ports/*android*",
|
|
|
|
"src/ports/*chromium*",
|
|
|
|
"src/ports/*fontconfig*",
|
|
|
|
"src/ports/*mozalloc*",
|
|
|
|
"src/ports/*nacl*",
|
|
|
|
"src/ports/*win*",
|
|
|
|
"src/ports/SkFontMgr_custom.cpp",
|
2017-02-08 22:29:33 +00:00
|
|
|
"src/ports/SkFontMgr_custom_directory.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_embedded.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_empty.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/ports/SkFontMgr_custom_directory_factory.cpp",
|
|
|
|
"src/ports/SkFontMgr_custom_embedded_factory.cpp",
|
2016-03-21 17:45:01 +00:00
|
|
|
"src/ports/SkFontMgr_custom_empty_factory.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/ports/SkFontMgr_empty_factory.cpp",
|
2017-02-09 20:28:53 +00:00
|
|
|
"src/ports/SkGlobalInitialization_none.cpp",
|
2018-06-20 13:34:05 +00:00
|
|
|
"src/ports/SkGlobalInitialization_none_imagefilters.cpp",
|
2015-11-02 19:11:21 +00:00
|
|
|
"src/ports/SkImageGenerator_none.cpp",
|
|
|
|
"src/ports/SkTLS_none.cpp",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-03-16 23:15:09 +00:00
|
|
|
################################################################################
|
|
|
|
## skia_srcs()
|
|
|
|
################################################################################
|
2017-10-17 14:57:34 +00:00
|
|
|
def skia_srcs(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""Sources to be compiled into the skia library."""
|
|
|
|
return skia_glob(BASE_SRCS_ALL) + skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
skia_glob(BASE_SRCS_UNIX),
|
|
|
|
skia_glob(BASE_SRCS_ANDROID),
|
|
|
|
skia_glob(BASE_SRCS_IOS),
|
|
|
|
],
|
|
|
|
)
|
2015-11-18 21:26:10 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## INCLUDES
|
|
|
|
################################################################################
|
2015-11-18 21:26:10 +00:00
|
|
|
|
2015-08-17 19:58:10 +00:00
|
|
|
# Includes needed by Skia implementation. Not public includes.
|
|
|
|
INCLUDES = [
|
2015-11-13 20:27:08 +00:00
|
|
|
"include/android",
|
2015-08-17 19:58:10 +00:00
|
|
|
"include/c",
|
|
|
|
"include/codec",
|
|
|
|
"include/config",
|
|
|
|
"include/core",
|
|
|
|
"include/effects",
|
2017-05-09 19:28:32 +00:00
|
|
|
"include/encode",
|
2015-08-17 19:58:10 +00:00
|
|
|
"include/gpu",
|
|
|
|
"include/pathops",
|
|
|
|
"include/ports",
|
|
|
|
"include/private",
|
|
|
|
"include/utils",
|
2015-11-02 19:11:21 +00:00
|
|
|
"include/utils/mac",
|
2015-11-13 20:27:08 +00:00
|
|
|
"src/codec",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/core",
|
|
|
|
"src/gpu",
|
|
|
|
"src/image",
|
2017-08-15 17:13:59 +00:00
|
|
|
"src/images",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/lazy",
|
|
|
|
"src/opts",
|
|
|
|
"src/pdf",
|
2018-03-26 19:46:40 +00:00
|
|
|
"src/ports",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/sfnt",
|
2017-05-30 20:39:47 +00:00
|
|
|
"src/shaders",
|
2016-09-30 19:06:27 +00:00
|
|
|
"src/sksl",
|
2015-08-17 19:58:10 +00:00
|
|
|
"src/utils",
|
2016-10-24 18:11:12 +00:00
|
|
|
"third_party/gif",
|
2016-01-13 18:45:19 +00:00
|
|
|
]
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## DM_SRCS
|
|
|
|
################################################################################
|
2015-10-26 17:46:25 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
DM_SRCS_ALL = struct(
|
|
|
|
include = [
|
2015-10-15 15:09:44 +00:00
|
|
|
"dm/*.cpp",
|
|
|
|
"dm/*.h",
|
2018-03-26 19:46:40 +00:00
|
|
|
"experimental/svg/model/*.cpp",
|
|
|
|
"experimental/svg/model/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"gm/*.cpp",
|
|
|
|
"gm/*.h",
|
2018-03-26 19:46:40 +00:00
|
|
|
"src/xml/*.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tests/*.cpp",
|
|
|
|
"tests/*.h",
|
2018-03-26 21:48:09 +00:00
|
|
|
"tools/ios_utils.h",
|
|
|
|
"tools/BinaryAsset.h",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/BigPathBench.inc",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/CrashHandler.cpp",
|
|
|
|
"tools/CrashHandler.h",
|
2018-05-30 12:27:26 +00:00
|
|
|
"tools/DDLPromiseImageHelper.cpp",
|
|
|
|
"tools/DDLPromiseImageHelper.h",
|
|
|
|
"tools/DDLTileHelper.cpp",
|
|
|
|
"tools/DDLTileHelper.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/ProcStats.cpp",
|
|
|
|
"tools/ProcStats.h",
|
2018-03-26 21:48:09 +00:00
|
|
|
"tools/Registry.h",
|
|
|
|
"tools/ResourceFactory.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/Resources.cpp",
|
|
|
|
"tools/Resources.h",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/SkJSONCPP.h",
|
|
|
|
"tools/UrlDataManager.cpp",
|
|
|
|
"tools/UrlDataManager.h",
|
|
|
|
"tools/debugger/*.cpp",
|
|
|
|
"tools/debugger/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/flags/*.cpp",
|
|
|
|
"tools/flags/*.h",
|
2018-02-20 22:06:07 +00:00
|
|
|
"tools/fonts/SkRandomScalerContext.cpp",
|
|
|
|
"tools/fonts/SkRandomScalerContext.h",
|
|
|
|
"tools/fonts/SkTestFontMgr.cpp",
|
|
|
|
"tools/fonts/SkTestFontMgr.h",
|
2018-02-15 15:20:04 +00:00
|
|
|
"tools/fonts/SkTestSVGTypeface.cpp",
|
|
|
|
"tools/fonts/SkTestSVGTypeface.h",
|
|
|
|
"tools/fonts/SkTestTypeface.cpp",
|
|
|
|
"tools/fonts/SkTestTypeface.h",
|
2018-02-20 22:06:07 +00:00
|
|
|
"tools/fonts/sk_tool_utils_font.cpp",
|
|
|
|
"tools/fonts/test_font_monospace.inc",
|
|
|
|
"tools/fonts/test_font_sans_serif.inc",
|
|
|
|
"tools/fonts/test_font_serif.inc",
|
|
|
|
"tools/fonts/test_font_index.inc",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu/**/*.cpp",
|
|
|
|
"tools/gpu/**/*.h",
|
2016-02-09 20:32:52 +00:00
|
|
|
"tools/random_parse_path.cpp",
|
|
|
|
"tools/random_parse_path.h",
|
2018-03-26 21:48:09 +00:00
|
|
|
"tools/sk_pixel_iter.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/sk_tool_utils.cpp",
|
|
|
|
"tools/sk_tool_utils.h",
|
2015-10-24 14:55:31 +00:00
|
|
|
"tools/timer/*.cpp",
|
|
|
|
"tools/timer/*.h",
|
2017-07-19 17:05:11 +00:00
|
|
|
"tools/trace/*.cpp",
|
|
|
|
"tools/trace/*.h",
|
2015-10-15 15:09:44 +00:00
|
|
|
],
|
|
|
|
exclude = [
|
2018-06-01 15:01:11 +00:00
|
|
|
"gm/cgms.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"tests/FontMgrAndroidParserTest.cpp", # Android-only.
|
2018-06-22 21:11:00 +00:00
|
|
|
"tests/FontMgrFontConfigTest.cpp", # FontConfig-only.
|
2015-10-15 15:09:44 +00:00
|
|
|
"tests/skia_test.cpp", # Old main.
|
2017-11-19 19:46:36 +00:00
|
|
|
"tools/gpu/atlastext/*",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu/gl/angle/*",
|
|
|
|
"tools/gpu/gl/egl/*",
|
|
|
|
"tools/gpu/gl/glx/*",
|
|
|
|
"tools/gpu/gl/iOS/*",
|
|
|
|
"tools/gpu/gl/mac/*",
|
|
|
|
"tools/gpu/gl/win/*",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/timer/SysTimer_mach.cpp",
|
2015-10-26 17:46:25 +00:00
|
|
|
"tools/timer/SysTimer_windows.cpp",
|
2015-10-15 15:09:44 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-03-16 23:15:09 +00:00
|
|
|
################################################################################
|
|
|
|
## dm_srcs()
|
|
|
|
################################################################################
|
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def dm_srcs(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
"""Sources for the dm binary for the specified os."""
|
|
|
|
return skia_glob(DM_SRCS_ALL) + skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
[],
|
|
|
|
["tests/FontMgrAndroidParserTest.cpp"],
|
|
|
|
[],
|
|
|
|
],
|
|
|
|
)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## DM_INCLUDES
|
|
|
|
################################################################################
|
2015-10-26 17:46:25 +00:00
|
|
|
|
2015-10-15 15:09:44 +00:00
|
|
|
DM_INCLUDES = [
|
2016-02-01 17:05:08 +00:00
|
|
|
"dm",
|
2015-10-15 15:09:44 +00:00
|
|
|
"gm",
|
2017-02-18 19:12:08 +00:00
|
|
|
"experimental/svg/model",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/codec",
|
2017-02-18 17:57:09 +00:00
|
|
|
"src/core",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/effects",
|
|
|
|
"src/fonts",
|
2016-11-23 15:55:18 +00:00
|
|
|
"src/images",
|
2015-10-15 15:09:44 +00:00
|
|
|
"src/pathops",
|
|
|
|
"src/pipe/utils",
|
2015-10-26 17:46:25 +00:00
|
|
|
"src/ports",
|
2017-05-30 20:39:47 +00:00
|
|
|
"src/shaders",
|
|
|
|
"src/shaders/gradients",
|
2017-02-18 14:51:33 +00:00
|
|
|
"src/xml",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tests",
|
|
|
|
"tools",
|
2016-07-28 22:12:21 +00:00
|
|
|
"tools/debugger",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/flags",
|
2018-02-20 22:06:07 +00:00
|
|
|
"tools/fonts",
|
2016-04-01 12:00:51 +00:00
|
|
|
"tools/gpu",
|
2015-10-15 15:09:44 +00:00
|
|
|
"tools/timer",
|
2017-07-19 17:05:11 +00:00
|
|
|
"tools/trace",
|
2015-10-15 15:09:44 +00:00
|
|
|
]
|
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## DM_ARGS
|
|
|
|
################################################################################
|
2016-01-12 20:00:49 +00:00
|
|
|
|
2016-11-28 20:30:37 +00:00
|
|
|
def DM_ARGS(asan):
|
2018-07-31 22:04:05 +00:00
|
|
|
source = ["tests", "gm", "image", "lottie"]
|
2018-07-31 14:31:06 +00:00
|
|
|
|
|
|
|
# TODO(benjaminwagner): f16, pic-8888, serialize-8888, and tiles_rt-8888 fail.
|
|
|
|
config = ["565", "8888", "pdf"]
|
|
|
|
match = ["~Codec_78329453"]
|
|
|
|
return (["--src"] + source + ["--config"] + config + ["--nonativeFonts"] +
|
|
|
|
["--match"] + match)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## COPTS
|
|
|
|
################################################################################
|
2015-11-02 19:11:21 +00:00
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def base_copts(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
return skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
# UNIX
|
|
|
|
[
|
|
|
|
"-Wno-implicit-fallthrough", # Some intentional fallthrough.
|
|
|
|
# Internal use of deprecated methods. :(
|
|
|
|
"-Wno-deprecated-declarations",
|
|
|
|
# TODO(kjlubick)
|
|
|
|
"-Wno-self-assign", # Spurious warning in tests/PathOpsDVectorTest.cpp?
|
|
|
|
],
|
|
|
|
# ANDROID
|
|
|
|
[
|
|
|
|
# 'GrResourceCache' declared with greater visibility than the
|
|
|
|
# type of its field 'GrResourceCache::fPurgeableQueue'... bogus.
|
|
|
|
"-Wno-error=attributes",
|
|
|
|
],
|
|
|
|
# IOS
|
2018-07-31 20:41:37 +00:00
|
|
|
[
|
|
|
|
"-Wno-implicit-fallthrough", # Some intentional fallthrough.
|
|
|
|
],
|
2018-07-31 14:31:06 +00:00
|
|
|
],
|
|
|
|
)
|
2016-01-13 18:45:19 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## DEFINES
|
|
|
|
################################################################################
|
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def base_defines(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
return [
|
|
|
|
# Chrome DEFINES.
|
|
|
|
"SK_USE_FREETYPE_EMBOLDEN",
|
|
|
|
# Turn on a few Google3-specific build fixes.
|
|
|
|
"SK_BUILD_FOR_GOOGLE3",
|
|
|
|
# Required for building dm.
|
|
|
|
"GR_TEST_UTILS",
|
|
|
|
# Staging flags for API changes
|
|
|
|
# Should remove after we update golden images
|
|
|
|
"SK_WEBP_ENCODER_USE_DEFAULT_METHOD",
|
|
|
|
# Experiment to diagnose image diffs in Google3
|
|
|
|
"SK_JUMPER_DISABLE_8BIT",
|
|
|
|
# JPEG is in codec_limited
|
|
|
|
"SK_HAS_JPEG_LIBRARY",
|
|
|
|
] + skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
# UNIX
|
|
|
|
[
|
|
|
|
"PNG_SKIP_SETJMP_CHECK",
|
|
|
|
"SK_BUILD_FOR_UNIX",
|
|
|
|
"SK_SAMPLES_FOR_X",
|
|
|
|
"SK_PDF_USE_SFNTLY",
|
|
|
|
"SK_CODEC_DECODES_RAW",
|
|
|
|
"SK_HAS_PNG_LIBRARY",
|
|
|
|
"SK_HAS_WEBP_LIBRARY",
|
|
|
|
],
|
|
|
|
# ANDROID
|
|
|
|
[
|
|
|
|
"SK_BUILD_FOR_ANDROID",
|
|
|
|
"SK_CODEC_DECODES_RAW",
|
|
|
|
"SK_HAS_PNG_LIBRARY",
|
|
|
|
"SK_HAS_WEBP_LIBRARY",
|
|
|
|
],
|
|
|
|
# IOS
|
|
|
|
[
|
|
|
|
"SK_BUILD_FOR_IOS",
|
|
|
|
"SK_BUILD_NO_OPTS",
|
|
|
|
"SKNX_NO_SIMD",
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
2015-08-17 19:58:10 +00:00
|
|
|
|
2016-01-13 18:45:19 +00:00
|
|
|
################################################################################
|
|
|
|
## LINKOPTS
|
|
|
|
################################################################################
|
2015-10-26 17:46:25 +00:00
|
|
|
|
2017-10-17 14:57:34 +00:00
|
|
|
def base_linkopts(os_conditions):
|
2018-07-31 14:31:06 +00:00
|
|
|
return [
|
|
|
|
"-ldl",
|
|
|
|
] + skia_select(
|
|
|
|
os_conditions,
|
|
|
|
[
|
|
|
|
# UNIX
|
|
|
|
[],
|
|
|
|
# ANDROID
|
|
|
|
[
|
|
|
|
"-lEGL",
|
|
|
|
],
|
|
|
|
# IOS
|
|
|
|
[
|
|
|
|
"-framework CoreFoundation",
|
|
|
|
"-framework CoreGraphics",
|
|
|
|
"-framework CoreText",
|
|
|
|
"-framework ImageIO",
|
|
|
|
"-framework MobileCoreServices",
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|