Index: BUILD.public |
diff --git a/BUILD.public b/BUILD.public |
index 832b3ad2edeed5a366fd90ab5f05ddadfd0a1c69..f72fbb1aecffa541aec5a040469437c70059bf26 100644 |
--- a/BUILD.public |
+++ b/BUILD.public |
@@ -11,7 +11,6 @@ SRCS = glob( |
"include/private/*.h", |
"src/**/*.h", |
"src/**/*.cpp", |
- "src/**/*.c", |
# Third Party |
"third_party/etc1/*.cpp", |
@@ -23,14 +22,20 @@ SRCS = glob( |
# Exclude platform-dependent files. |
"src/device/xps/*", # Windows-only. Move to ports? |
"src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
+ "src/doc/SkDocument_PDF.cpp", # Doesn't compile on Android. |
mtklein
2015/10/20 17:48:55
This is surprising. SkDocument_PDF should work fi
dogben
2015/10/20 22:21:03
There is an issue with sfntly. It seems to compile
|
"src/gpu/gl/android/*", |
+ "src/gpu/gl/egl/*", |
+ "src/gpu/gl/glx/*", |
+ "src/gpu/gl/nacl/*", |
"src/gpu/gl/iOS/*", |
"src/gpu/gl/mac/*", |
"src/gpu/gl/win/*", |
"src/opts/**/*", |
+ "src/pdf/**/*", # Doesn't compile on Android. |
"src/ports/**/*", |
"src/utils/android/**/*", |
"src/utils/mac/**/*", |
+ "src/utils/SkThreadUtils_pthread_linux.cpp", # Linux-only. Move to ports? |
mtklein
2015/10/20 17:48:55
Most of this SkThreadUtils stuff is pointless. I'
dogben
2015/10/20 22:21:03
Removed, modulo win.
|
"src/utils/SkThreadUtils_pthread_mach.cpp", # Mac-only. Move to ports? |
"src/utils/SkThreadUtils_pthread_other.cpp", # Non-Mac-non-Linux. Move to ports? |
"src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? |
@@ -42,11 +47,10 @@ SRCS = glob( |
# Exclude multiple definitions. |
# TODO(mtklein): Move to opts? |
"src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. |
+ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
mtklein
2015/10/20 17:48:55
Why resort g above f?
dogben
2015/10/20 22:21:03
Cuz I ain't no gud at them their alfabits.
|
+ "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
+ "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
"src/fonts/*fontconfig*", |
- "src/gpu/gl/egl/*", # Conflicts with gpu/gl/glx. |
- "src/gpu/gl/nacl/*", # Conflicts with gpu/gl/glx. |
- "src/gpu/gl/GrGLDefaultInterface_none.cpp", # Conflicts with src/gpu/gl/GrGLDefaultInterface_native.cpp |
- "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", # Conflicts with src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp |
# Exclude files that don't compile with the current DEFINES. |
"src/gpu/gl/angle/*", # Requires SK_ANGLE define. |
@@ -67,24 +71,33 @@ SRCS = glob( |
) |
# Platform-dependent SRCS for google3-default platform. |
-PLATFORM_SRCS = glob( |
+SRCS_UNIX = glob( |
[ |
+ "src/doc/SkDocument_PDF.cpp", # Doesn't compile on Android. |
+ "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
+ "src/gpu/gl/glx/**/*.cpp", |
+ "src/gpu/gl/glx/**/*.h", |
"src/opts/**/*.cpp", |
"src/opts/**/*.h", |
+ "src/pdf/**/*.cpp", # Doesn't compile on Android. |
+ "src/pdf/**/*.h", # Doesn't compile on Android. |
"src/ports/**/*.cpp", |
"src/ports/**/*.h", |
+ "src/utils/SkThreadUtils_pthread_linux.cpp", |
], |
exclude = [ |
"src/opts/*arm*", |
"src/opts/*mips*", |
"src/opts/*NEON*", |
"src/opts/*neon*", |
+ # Included in :opts_ssse3 library. |
"src/opts/*SSSE3*", |
"src/opts/*ssse3*", |
+ # Included in :opts_sse4 library. |
"src/opts/*SSE4*", |
"src/opts/*sse4*", |
- "src/opts/SkBlitMask_opts_none.cpp", |
"src/opts/SkBitmapProcState_opts_none.cpp", |
+ "src/opts/SkBlitMask_opts_none.cpp", |
"src/opts/SkBlitRow_opts_none.cpp", |
"src/ports/*android*", |
"src/ports/*chromium*", |
@@ -104,6 +117,59 @@ PLATFORM_SRCS = glob( |
], |
) |
+# Platform-dependent SRCS for google3-default Android. |
+SRCS_ANDROID = glob( |
+ [ |
+ "src/doc/SkDocument_PDF_None.cpp", |
+ # TODO(benjaminwagner): Figure out how to compile with EGL. |
+ "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
+ "src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp", |
+ "src/opts/**/*.cpp", |
+ "src/opts/**/*.h", |
+ "src/ports/**/*.cpp", |
+ "src/ports/**/*.h", |
+ "src/utils/SkThreadUtils_pthread_other.cpp", # Non-Mac-non-Linux. Move to ports? |
+ ], |
+ exclude = [ |
+ # Included in :opts_arm library. |
+ "src/opts/*arm*", |
+ "src/opts/*mips*", |
+ # Included in :opts_neon library. |
+ "src/opts/*NEON*", |
+ "src/opts/*neon*", |
+ "src/opts/*SSE2*", |
+ "src/opts/*SSSE3*", |
+ "src/opts/*ssse3*", |
+ "src/opts/*SSE4*", |
+ "src/opts/*sse4*", |
+ "src/opts/*x86*", |
+ "src/opts/SkBitmapProcState_opts_none.cpp", |
+ "src/opts/SkBlitMask_opts_none.cpp", |
+ "src/opts/SkBlitRow_opts_none.cpp", |
+ "src/ports/*chromium*", |
+ "src/ports/*CG*", |
+ "src/ports/*fontconfig*", |
+ "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", |
+ "src/ports/SkFontMgr_empty_factory.cpp", |
+ "src/ports/SkImageDecoder_WIC.cpp", |
+ "src/ports/SkImageDecoder_empty.cpp", |
+ "src/ports/SkImageGenerator_none.cpp", |
+ "src/ports/SkTLS_none.cpp", |
+ ], |
+) |
+ |
+PLATFORM_SRCS = select({ |
+ CONDITION_ANDROID: SRCS_ANDROID, |
+ "//conditions:default": SRCS_UNIX, |
+}) |
+ |
SRCS_SSSE3 = glob( |
[ |
"src/opts/*SSSE3*.cpp", |
@@ -161,6 +227,22 @@ INCLUDES = [ |
"third_party/ktx", |
] |
+DEPS_UNIX = [ |
+ ":opts_sse4", |
+ ":opts_ssse3", |
+] |
+ |
+DEPS_ANDROID = [ |
+ ":opts_arm", |
+ ":opts_neon", |
+] |
+ |
+DEPS = select({ |
+ CONDITION_ANDROID: DEPS_ANDROID + EXTERNAL_DEPS_ANDROID, |
+ "//conditions:default": DEPS_UNIX + EXTERNAL_DEPS_UNIX, |
+}) |
+ |
+# Platform-independent SRCS for DM. |
DM_SRCS = glob( |
[ |
"dm/*.cpp", |
@@ -193,16 +275,36 @@ DM_SRCS = glob( |
"tools/sk_tool_utils.h", |
], |
exclude = [ |
+ "dm/DMSrcSinkAndroid.cpp", # Android-only. |
+ "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
+ "tests/PathOpsSkpClipTest.cpp", # Alternate main. |
+ "tests/PDF*", # Dependencies don't compile on Android. |
"tests/skia_test.cpp", # Old main. |
"tests/SkpSkGrTest.cpp", # Alternate main. |
- "tests/PathOpsSkpClipTest.cpp", # Alternate main. |
- "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
- "dm/DMSrcSinkAndroid.cpp", # Android-only. |
- "tools/timer/SysTimer_windows.cpp", |
"tools/timer/SysTimer_mach.cpp", |
+ "tools/timer/SysTimer_windows.cpp", |
], |
) |
+DM_SRCS_UNIX = glob( |
+ [ |
+ "tests/PDF*.cpp", |
+ ], |
+) |
+ |
+DM_SRCS_ANDROID = glob( |
+ [ |
+ # Depends on Android HWUI library that is not available in google3. |
+ #"dm/DMSrcSinkAndroid.cpp", |
+ "tests/FontMgrAndroidParserTest.cpp", |
+ ], |
+) |
+ |
+DM_PLATFORM_SRCS = select({ |
+ CONDITION_ANDROID: DM_SRCS_ANDROID, |
+ "//conditions:default": DM_SRCS_UNIX, |
+}) |
+ |
DM_INCLUDES = [ |
"gm", |
"src/codec", |
@@ -210,6 +312,7 @@ DM_INCLUDES = [ |
"src/fonts", |
"src/pathops", |
"src/pipe/utils", |
+ "src/ports", |
"src/utils/debugger", |
"tests", |
"tools", |
@@ -217,11 +320,31 @@ DM_INCLUDES = [ |
"tools/timer", |
] |
-COPTS = [ |
+COPTS_ANDROID = [ |
+] |
+ |
+COPTS_UNIX = [ |
"-Wno-implicit-fallthrough", # Some intentional fallthrough. |
] |
-DEFINES = [ |
+COPTS = select({ |
+ CONDITION_ANDROID: COPTS_ANDROID, |
+ "//conditions:default": COPTS_UNIX, |
+}) |
+ |
+DEFINES_ANDROID = [ |
+ "SK_BUILD_FOR_ANDROID", |
+ "SK_ARM_HAS_OPTIONAL_NEON", |
mtklein
2015/10/20 17:48:55
Probably safe to go with SK_ARM_HAS_NEON. We inte
dogben
2015/10/20 22:21:03
So, SK_ARM_HAS_NEON enables this line in SkBlitter
|
+ # TODO(benjaminwagner): Try to get png library updated? |
+ "SK_PNG_NO_INDEX_SUPPORTED", |
+] |
+ |
+DEFINES_UNIX = [ |
+ "SK_BUILD_FOR_UNIX", |
+ "SK_SAMPLES_FOR_X", |
+] |
+ |
+DEFINES_ALL = [ |
# It'd be nice for fastbuild, dbg -> SK_DEBUG, opt -> SK_RELEASE. |
"SK_RELEASE", |
# Chrome DEFINES. |
@@ -229,11 +352,20 @@ DEFINES = [ |
"SK_USE_FREETYPE_EMBOLDEN", |
# Turn on a few Google3-specific build fixes. |
"GOOGLE3", |
- "SK_BUILD_FOR_UNIX", |
- "SK_SAMPLES_FOR_X", |
] |
-LINKOPTS = ["-ldl"] |
+DEFINES = select({ |
+ CONDITION_ANDROID: DEFINES_ANDROID, |
+ "//conditions:default": DEFINES_UNIX, |
+}) + DEFINES_ALL |
+ |
+LINKOPTS = select({ |
+ CONDITION_ANDROID: [ |
+ "-ldl", |
+ "-lEGL", |
+ ], |
+ "//conditions:default": ["-ldl"], |
+}) |
cc_library( |
name = "opts_ssse3", |
@@ -252,6 +384,30 @@ cc_library( |
) |
cc_library( |
+ name = "opts_arm", |
+ srcs = glob([ |
+ "src/opts/*_opts_arm.cpp", |
+ "src/opts/*_opts_arm.h", |
+ ]), |
+ # Some of these files use fp as a general register. |
+ copts = COPTS + ["-fomit-frame-pointer"], |
mtklein
2015/10/20 17:48:55
Try dropping this? I think this is no longer true
dogben
2015/10/20 22:21:03
Done.
|
+ defines = DEFINES, |
+ includes = INCLUDES, |
+) |
+ |
+cc_library( |
+ name = "opts_neon", |
+ srcs = glob([ |
+ "src/opts/*neon*.cpp", |
+ "src/opts/*neon*.h", |
+ "src/opts/Sk4px_NEON.h", |
+ ]), |
+ copts = COPTS + ["-mfpu=neon"], |
+ defines = DEFINES, |
+ includes = INCLUDES, |
+) |
+ |
+cc_library( |
name = "skia", |
srcs = SRCS + PLATFORM_SRCS, |
hdrs = HDRS, |
@@ -260,16 +416,13 @@ cc_library( |
includes = INCLUDES, |
linkopts = LINKOPTS, |
visibility = [":skia_clients"], |
- deps = EXTERNAL_DEPS + [ |
- ":opts_sse4", |
- ":opts_ssse3", |
- ], |
+ deps = DEPS, |
) |
cc_test( |
name = "dm", |
size = "large", |
- srcs = DM_SRCS, |
+ srcs = DM_SRCS + DM_PLATFORM_SRCS, |
args = [ |
"--nogpu", |
"--verbose", |