From: iroth Date: Mon, 2 Nov 2015 19:11:21 +0000 (-0800) Subject: Enable building Skia for iOS with bazel. X-Git-Tag: submit/tizen/20180928.044319~364 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b99ef434736791eefb31ecaa590a649dff83aed;p=platform%2Fupstream%2FlibSkiaSharp.git Enable building Skia for iOS with bazel. BUG=skia: Review URL: https://codereview.chromium.org/1429863002 --- diff --git a/BUILD.public b/BUILD.public index a2569e2645..9c66d3a111 100644 --- a/BUILD.public +++ b/BUILD.public @@ -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 diff --git a/tools/flags/SkCommandLineFlags.cpp b/tools/flags/SkCommandLineFlags.cpp index 2fe7824c84..9b2c9616cb 100644 --- a/tools/flags/SkCommandLineFlags.cpp +++ b/tools/flags/SkCommandLineFlags.cpp @@ -11,8 +11,8 @@ #include -#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.");