Enable building Skia for iOS with bazel.
authoriroth <iroth@google.com>
Mon, 2 Nov 2015 19:11:21 +0000 (11:11 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 2 Nov 2015 19:11:21 +0000 (11:11 -0800)
BUG=skia:

Review URL: https://codereview.chromium.org/1429863002

BUILD.public
tools/flags/SkCommandLineFlags.cpp

index a2569e26452258b7c0da946f93d7cb6eb4948491..9c66d3a111766e19ecdb30ef453c4c6d0e462cdf 100644 (file)
@@ -147,8 +147,52 @@ SRCS_ANDROID = glob(
     ],
 )
 
+# Platform-dependent SRCS for google3-default iOS.
+SRCS_IOS = glob(
+    [
+        "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp",
+        "src/opts/**/*.cpp",
+        "src/opts/**/*.h",
+        "src/ports/**/*.cpp",
+        "src/ports/**/*.h",
+    ],
+    exclude = [
+        "src/opts/*mips*",
+        "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/*android*",
+        "src/ports/*chromium*",
+        "src/ports/*fontconfig*",
+        "src/ports/*FontConfig*",
+        "src/ports/*FreeType*",
+        "src/ports/*mozalloc*",
+        "src/ports/*nacl*",
+        "src/ports/*win*",
+        "src/ports/SkDebug_stdio.cpp",
+        "src/ports/SkFontMgr_custom.cpp",
+        "src/ports/SkFontMgr_custom_directory_factory.cpp",
+        "src/ports/SkFontMgr_custom_embedded_factory.cpp",
+        "src/ports/SkFontMgr_empty_factory.cpp",
+        "src/ports/SkImageDecoder_CG.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,
+    CONDITION_IOS: SRCS_IOS,
     "//conditions:default": SRCS_UNIX,
 })
 
@@ -195,6 +239,8 @@ INCLUDES = [
     "include/ports",
     "include/private",
     "include/utils",
+    "include/utils/mac",
+    "include/utils/win",
     "include/svg",
     "include/xml",
     "src/core",
@@ -209,6 +255,7 @@ INCLUDES = [
     "third_party/ktx",
 ]
 
+# Dependencies.
 DEPS_UNIX = [
     ":opts_sse4",
     ":opts_ssse3",
@@ -216,10 +263,13 @@ DEPS_UNIX = [
 
 DEPS_ANDROID = []
 
+DEPS_IOS = []
+
 DEPS = select({
-    CONDITION_ANDROID: DEPS_ANDROID + EXTERNAL_DEPS_ANDROID + EXTERNAL_DEPS_ALL,
-    "//conditions:default": DEPS_UNIX + EXTERNAL_DEPS_UNIX + EXTERNAL_DEPS_ALL,
-})
+    CONDITION_ANDROID: DEPS_ANDROID + EXTERNAL_DEPS_ANDROID,
+    CONDITION_IOS: DEPS_IOS + EXTERNAL_DEPS_IOS,
+    "//conditions:default": DEPS_UNIX + EXTERNAL_DEPS_UNIX,
+}) + EXTERNAL_DEPS_ALL
 
 # Platform-independent SRCS for DM.
 DM_SRCS = glob(
@@ -300,6 +350,9 @@ COPTS_ANDROID = [
     "-mfpu=neon",
 ]
 
+COPTS_IOS = [
+]
+
 COPTS_UNIX = [
     "-Wno-implicit-fallthrough",  # Some intentional fallthrough.
     "-Wno-deprecated-declarations",  # Internal use of deprecated methods. :(
@@ -307,6 +360,7 @@ COPTS_UNIX = [
 
 COPTS = select({
     CONDITION_ANDROID: COPTS_ANDROID,
+    CONDITION_IOS: COPTS_IOS,
     "//conditions:default": COPTS_UNIX,
 })
 
@@ -316,6 +370,11 @@ DEFINES_ANDROID = [
     "SK_PNG_NO_INDEX_SUPPORTED",
 ]
 
+DEFINES_IOS = [
+    "SK_BUILD_FOR_IOS",
+    "SK_IGNORE_ETC1_SUPPORT",
+]
+
 DEFINES_UNIX = [
     "SK_BUILD_FOR_UNIX",
     "SK_SAMPLES_FOR_X",
@@ -331,6 +390,7 @@ DEFINES_ALL = [
 
 DEFINES = select({
     CONDITION_ANDROID: DEFINES_ANDROID,
+    CONDITION_IOS: DEFINES_IOS,
     "//conditions:default": DEFINES_UNIX,
 }) + DEFINES_ALL
 
index 2fe7824c84e465e652648500e5cfe2c684a80120..9b2c9616cbf4ebc0a70c4bfc33cc98910053bc4d 100644 (file)
@@ -11,8 +11,8 @@
 
 #include <stdlib.h>
 
-#if defined(GOOGLE3) && defined(SK_BUILD_FOR_ANDROID)
-    // I don't know why, but this is defined by //base only for Android.
+#if defined(GOOGLE3) && (defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_IOS))
+    // I don't know why, but this is defined by //base only for non-Linux.
     DECLARE_bool(undefok)
 #else
     DEFINE_bool(undefok, false, "Silently ignore unknown flags instead of crashing.");