Index: BUILD.public |
diff --git a/BUILD.public b/BUILD.public |
index 9c66d3a111766e19ecdb30ef453c4c6d0e462cdf..96e5e121e6d28d95abaf16f2d44334114248b6da 100644 |
--- a/BUILD.public |
+++ b/BUILD.public |
@@ -5,8 +5,10 @@ |
exports_files(["BUILD.public"]) |
-# Platform-independent SRCS |
-SRCS = glob( |
+## :skia_base |
+ |
+# All platform-independent SRCS, minus GL and utils. |
+BASE_SRCS = glob( |
[ |
"include/private/*.h", |
"src/**/*.h", |
@@ -22,13 +24,6 @@ SRCS = glob( |
# Exclude platform-dependent files. |
"src/device/xps/*", # Windows-only. Move to ports? |
"src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
- "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/ports/**/*", |
"src/utils/android/**/*", |
@@ -39,19 +34,17 @@ SRCS = glob( |
"src/views/win/*", |
"src/views/unix/*", |
+ # Exclude files in :skia_gl or :skia_util libraries. |
+ "src/gpu/gl/**/*", |
+ "src/utils/SkLua*", # In :skia_util library. |
+ |
# Exclude multiple definitions. |
# TODO(mtklein): Move to opts? |
"src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. |
"src/fonts/*fontconfig*", |
- "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
- "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
- "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
# Exclude files that don't compile with the current DEFINES. |
"src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch. |
- "src/gpu/gl/angle/*", # Requires SK_ANGLE define. |
- "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' |
- "src/gpu/gl/mesa/*", # Requires SK_MESA define. |
"src/svg/parser/*", # Missing SkSVG.h. |
# Not used. |
@@ -64,11 +57,8 @@ SRCS = glob( |
) |
# Platform-dependent SRCS for google3-default platform. |
-SRCS_UNIX = glob( |
+BASE_SRCS_UNIX = glob( |
[ |
- "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
- "src/gpu/gl/glx/**/*.cpp", |
- "src/gpu/gl/glx/**/*.h", |
"src/opts/**/*.cpp", |
"src/opts/**/*.h", |
"src/ports/**/*.cpp", |
@@ -107,11 +97,8 @@ SRCS_UNIX = glob( |
) |
# Platform-dependent SRCS for google3-default Android. |
-SRCS_ANDROID = glob( |
+BASE_SRCS_ANDROID = glob( |
[ |
- # 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", |
@@ -148,9 +135,8 @@ SRCS_ANDROID = glob( |
) |
# Platform-dependent SRCS for google3-default iOS. |
-SRCS_IOS = glob( |
+BASE_SRCS_IOS = glob( |
[ |
- "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp", |
"src/opts/**/*.cpp", |
"src/opts/**/*.h", |
"src/ports/**/*.cpp", |
@@ -190,41 +176,150 @@ SRCS_IOS = glob( |
], |
) |
-PLATFORM_SRCS = select({ |
- CONDITION_ANDROID: SRCS_ANDROID, |
- CONDITION_IOS: SRCS_IOS, |
- "//conditions:default": SRCS_UNIX, |
+BASE_SRCS_PLATFORM = select({ |
+ CONDITION_ANDROID: BASE_SRCS_ANDROID, |
+ CONDITION_IOS: BASE_SRCS_IOS, |
+ "//conditions:default": BASE_SRCS_UNIX, |
}) |
-SRCS_SSSE3 = glob( |
+SSSE3_SRCS = glob( |
[ |
"src/opts/*SSSE3*.cpp", |
"src/opts/*ssse3*.cpp", |
], |
) |
-SRCS_SSE4 = glob( |
+SSE4_SRCS = glob( |
[ |
"src/opts/*SSE4*.cpp", |
"src/opts/*sse4*.cpp", |
], |
) |
-HDRS = glob( |
+BASE_HDRS = glob( |
[ |
"include/**/*.h", |
], |
exclude = [ |
"include/private/**/*", |
+ "include/gpu/gl/**/*", # In :skia_gl library. |
+ "include/utils/SkLua*", # In :skia_util library. |
# Not used. |
"include/animator/**/*", |
"include/views/**/*", |
+ "include/utils/mac/**/*", |
+ "include/utils/win/**/*", |
"include/xml/SkBML_WXMLParser.h", |
"include/xml/SkBML_XMLParser.h", |
], |
) |
+# Dependencies. |
+BASE_DEPS_UNIX = [ |
+ ":opts_sse4", |
+ ":opts_ssse3", |
+] |
+ |
+BASE_DEPS_ANDROID = [] |
+ |
+BASE_DEPS_IOS = [] |
+ |
+BASE_DEPS = select({ |
+ CONDITION_ANDROID: BASE_DEPS_ANDROID + BASE_EXTERNAL_DEPS_ANDROID, |
+ CONDITION_IOS: BASE_DEPS_IOS + BASE_EXTERNAL_DEPS_IOS, |
+ "//conditions:default": BASE_DEPS_UNIX + BASE_EXTERNAL_DEPS_UNIX, |
+}) + EXTERNAL_DEPS_ALL |
+ |
+## :skia_gl |
+ |
+# Platform-independent :skia_gl SRCS. |
+GL_SRCS = glob( |
+ [ |
+ "src/gpu/gl/**/*.cpp", |
+ "src/gpu/gl/**/*.h", |
+ ], |
+ exclude = [ |
+ # Exclude platform-dependent files. |
+ "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/*", |
+ |
+ # Exclude multiple definitions. |
+ # TODO(mtklein): Move to opts? |
+ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
+ "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
+ "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
+ |
+ # Exclude files that don't compile with the current DEFINES. |
+ "src/gpu/gl/angle/*", # Requires SK_ANGLE define. |
+ "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' |
+ "src/gpu/gl/mesa/*", # Requires SK_MESA define. |
+ ], |
+) |
+ |
+# Platform-dependent :skia_gl SRCS for google3-default platform. |
+GL_SRCS_UNIX = glob( |
+ [ |
+ "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
+ "src/gpu/gl/glx/**/*.cpp", |
+ "src/gpu/gl/glx/**/*.h", |
+ ], |
+) |
+ |
+# Platform-dependent :skia_gl SRCS for google3-default Android. |
+GL_SRCS_ANDROID = glob( |
+ [ |
+ # TODO(benjaminwagner): Figure out how to compile with EGL. |
+ "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
+ "src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp", |
+ ], |
+) |
+ |
+# Platform-dependent :skia_gl SRCS for google3-default iOS. |
+GL_SRCS_IOS = glob( |
mtklein
2015/11/05 20:37:17
Is there some tool that yells at us if we write th
dogben
2015/11/06 00:18:18
Done.
|
+ [ |
+ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp", |
+ ], |
+) |
+ |
+GL_SRCS_PLATFORM = select({ |
+ CONDITION_ANDROID: GL_SRCS_ANDROID, |
+ CONDITION_IOS: GL_SRCS_IOS, |
+ "//conditions:default": GL_SRCS_UNIX, |
+}) |
+ |
+GL_HDRS = glob( |
+ [ |
+ "include/gpu/gl/**/*.h", |
+ ], |
+) |
+ |
+GL_DEPS = [":skia_base"] + select({ |
+ CONDITION_ANDROID: GL_EXTERNAL_DEPS_ANDROID, |
+ CONDITION_IOS: GL_EXTERNAL_DEPS_IOS, |
+ "//conditions:default": GL_EXTERNAL_DEPS_UNIX, |
+}) + EXTERNAL_DEPS_ALL |
+ |
+## :skia_util |
+ |
+# Platform-independent :skia_util SRCS. |
+UTIL_SRCS = glob( |
+ [ |
+ "src/utils/SkLua*.cpp", |
+ ], |
+) |
+ |
+UTIL_HDRS = glob( |
+ [ |
+ "include/utils/SkLua*.h", |
+ ], |
+) |
+ |
# Includes needed by Skia implementation. Not public includes. |
INCLUDES = [ |
"include/c", |
@@ -255,21 +350,7 @@ INCLUDES = [ |
"third_party/ktx", |
] |
-# Dependencies. |
-DEPS_UNIX = [ |
- ":opts_sse4", |
- ":opts_ssse3", |
-] |
- |
-DEPS_ANDROID = [] |
- |
-DEPS_IOS = [] |
- |
-DEPS = select({ |
- CONDITION_ANDROID: DEPS_ANDROID + EXTERNAL_DEPS_ANDROID, |
- CONDITION_IOS: DEPS_IOS + EXTERNAL_DEPS_IOS, |
- "//conditions:default": DEPS_UNIX + EXTERNAL_DEPS_UNIX, |
-}) + EXTERNAL_DEPS_ALL |
+## :dm |
# Platform-independent SRCS for DM. |
DM_SRCS = glob( |
@@ -404,7 +485,7 @@ LINKOPTS = select({ |
cc_library( |
name = "opts_ssse3", |
- srcs = SRCS_SSSE3, |
+ srcs = SSSE3_SRCS, |
copts = COPTS + ["-mssse3"], |
defines = DEFINES, |
includes = INCLUDES, |
@@ -413,26 +494,63 @@ cc_library( |
cc_library( |
name = "opts_sse4", |
- srcs = SRCS_SSE4, |
+ srcs = SSE4_SRCS, |
copts = COPTS + ["-msse4"], |
defines = DEFINES, |
includes = INCLUDES, |
deps = EXTERNAL_DEPS_ALL, |
) |
+# For clients that can not use :skia due to dependencies on GL or Lua. |
cc_library( |
- name = "skia", |
- srcs = SRCS + PLATFORM_SRCS, |
- hdrs = HDRS, |
+ name = "skia_base", |
+ srcs = BASE_SRCS + BASE_SRCS_PLATFORM, |
+ hdrs = BASE_HDRS, |
copts = COPTS, |
defines = DEFINES, |
includes = INCLUDES, |
linkopts = LINKOPTS, |
visibility = [":skia_clients"], |
- deps = DEPS, |
+ deps = BASE_DEPS, |
alwayslink = 1, |
) |
+cc_library( |
+ name = "skia_gl", |
+ srcs = GL_SRCS + GL_SRCS_PLATFORM, |
+ hdrs = GL_HDRS, |
+ copts = COPTS, |
+ defines = DEFINES, |
+ includes = INCLUDES, |
+ linkopts = LINKOPTS, |
+ deps = GL_DEPS, |
+ alwayslink = 1, |
+) |
+ |
+cc_library( |
mtklein
2015/11/05 20:37:17
Let's leave out Lua entirely. It's way less impor
dogben
2015/11/06 00:18:18
No. See internal CL description.
|
+ name = "skia_util", |
+ srcs = UTIL_SRCS, |
+ hdrs = UTIL_HDRS, |
+ copts = COPTS, |
+ defines = DEFINES, |
+ includes = INCLUDES, |
+ linkopts = LINKOPTS, |
+ deps = [":skia_base"] + UTIL_EXTERNAL_DEPS + EXTERNAL_DEPS_ALL, |
+ alwayslink = 1, |
+) |
+ |
+cc_library( |
+ name = "skia", |
+ # See b/15420638 |
+ hdrs = BASE_HDRS + GL_HDRS + UTIL_HDRS, |
+ visibility = [":skia_clients"], |
+ deps = [ |
+ ":skia_base", |
+ ":skia_gl", |
+ ":skia_util", |
+ ], |
+) |
+ |
cc_test( |
name = "dm", |
size = "large", |