diff options
-rw-r--r-- | BUILD.gn | 34 | ||||
-rw-r--r-- | include/core/SkPreConfig.h | 4 | ||||
-rw-r--r-- | src/ports/SkOSFile_stdio.cpp | 4 | ||||
-rw-r--r-- | third_party/BUILD.gn | 39 | ||||
-rw-r--r-- | third_party/third_party.gni | 15 | ||||
-rw-r--r-- | third_party/zlib/BUILD.gn | 35 |
6 files changed, 79 insertions, 52 deletions
@@ -70,13 +70,17 @@ skia_library_configs = [ ":skia_library", ] -# Chrome's GN environment is mostly helpful, but a couple default configs tend to get in the way. -unwanted_configs = [ - "//build/config/clang:find_bad_constructs", # Chrome style checks. - "//build/config:feature_flags", # A bunch of #defines we don't care about. -] +unwanted_configs = [] + +if (!is_fuchsia) { + # Chrome's GN environment is mostly helpful, but a couple default configs tend to get in the way. + unwanted_configs += [ + "//build/config/clang:find_bad_constructs", # Chrome style checks. + "//build/config:feature_flags", # A bunch of #defines we don't care about. + ] +} -core_gypi = exec_script("build/gypi_to_gn.py", +core_gypi = exec_script("//build/gypi_to_gn.py", [ rebase_path("gyp/core.gypi"), "--replace=<(skia_include_path)=include", @@ -85,7 +89,7 @@ core_gypi = exec_script("build/gypi_to_gn.py", "scope", [ "gyp/core.gypi" ]) -effects_gypi = exec_script("build/gypi_to_gn.py", +effects_gypi = exec_script("//build/gypi_to_gn.py", [ rebase_path("gyp/effects.gypi"), "--replace=<(skia_include_path)=include", @@ -94,7 +98,7 @@ effects_gypi = exec_script("build/gypi_to_gn.py", "scope", [ "gyp/effects.gypi" ]) -gpu_gypi = exec_script("build/gypi_to_gn.py", +gpu_gypi = exec_script("//build/gypi_to_gn.py", [ rebase_path("gyp/gpu.gypi"), "--replace=<(skia_include_path)=include", @@ -103,7 +107,7 @@ gpu_gypi = exec_script("build/gypi_to_gn.py", "scope", [ "gyp/gpu.gypi" ]) -opts_gypi = exec_script("build/gypi_to_gn.py", +opts_gypi = exec_script("//build/gypi_to_gn.py", [ rebase_path("gyp/opts.gypi"), "--replace=<(skia_include_path)=include", @@ -112,7 +116,7 @@ opts_gypi = exec_script("build/gypi_to_gn.py", "scope", [ "gyp/opts.gypi" ]) -pdf_gypi = exec_script("build/gypi_to_gn.py", +pdf_gypi = exec_script("//build/gypi_to_gn.py", [ rebase_path("gyp/pdf.gypi"), "--replace=<(skia_include_path)=include", @@ -121,7 +125,7 @@ pdf_gypi = exec_script("build/gypi_to_gn.py", "scope", [ "gyp/pdf.gypi" ]) -utils_gypi = exec_script("build/gypi_to_gn.py", +utils_gypi = exec_script("//build/gypi_to_gn.py", [ rebase_path("gyp/utils.gypi"), "--replace=<(skia_include_path)=include", @@ -163,7 +167,7 @@ component("skia") { ":opts_avx", ":opts_sse41", ":opts_ssse3", - "third_party:zlib", + "//third_party/zlib", ] libs = [] @@ -239,6 +243,12 @@ component("skia") { ] libs += [ "ApplicationServices.framework" ] } + + if (is_fuchsia) { + sources += [ + "src/ports/SkFontMgr_empty_factory.cpp", + ] + } } executable("example") { diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index c410c988b5..8c8eeef246 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -30,8 +30,8 @@ #define SK_BUILD_FOR_ANDROID #elif defined(linux) || defined(__linux) || defined(__FreeBSD__) || \ defined(__OpenBSD__) || defined(__sun) || defined(__NetBSD__) || \ - defined(__DragonFly__) || defined(__GLIBC__) || defined(__GNU__) || \ - defined(__unix__) + defined(__DragonFly__) || defined(__Fuchsia__) || \ + defined(__GLIBC__) || defined(__GNU__) || defined(__unix__) #define SK_BUILD_FOR_UNIX #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR #define SK_BUILD_FOR_IOS diff --git a/src/ports/SkOSFile_stdio.cpp b/src/ports/SkOSFile_stdio.cpp index 915b87b67b..f008283804 100644 --- a/src/ports/SkOSFile_stdio.cpp +++ b/src/ports/SkOSFile_stdio.cpp @@ -12,6 +12,10 @@ #include <stdio.h> #include <sys/stat.h> +#ifdef SK_BUILD_FOR_UNIX +#include <unistd.h> +#endif + #ifdef _WIN32 #include <direct.h> #include <io.h> diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn index 3ab094cd29..96837d2b3a 100644 --- a/third_party/BUILD.gn +++ b/third_party/BUILD.gn @@ -3,8 +3,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -declare_args() { -} +import("third_party.gni") # Most third_party code should disable warnings: if we don't maintain the code, warnings are noise. config("no_warnings") { @@ -12,42 +11,6 @@ config("no_warnings") { } third_party_configs = [ ":no_warnings" ] -# Chrome's GN environment sets up a bunch of default configs we don't need/want here. -unwanted_configs = [ - "//build/config/clang:extra_warnings", - "//build/config/clang:find_bad_constructs", - "//build/config/compiler:chromium_code", - "//build/config:feature_flags", -] - -config("zlib_public") { - include_dirs = [ "externals/zlib" ] -} -source_set("zlib") { - public_configs = [ ":zlib_public" ] - configs += third_party_configs - configs -= unwanted_configs - - sources = [ - "externals/zlib/adler32.c", - "externals/zlib/compress.c", - "externals/zlib/crc32.c", - "externals/zlib/deflate.c", - "externals/zlib/gzclose.c", - "externals/zlib/gzlib.c", - "externals/zlib/gzread.c", - "externals/zlib/gzwrite.c", - "externals/zlib/infback.c", - "externals/zlib/inffast.c", - "externals/zlib/inflate.c", - "externals/zlib/inftrees.c", - "externals/zlib/simd_stub.c", - "externals/zlib/trees.c", - "externals/zlib/uncompr.c", - "externals/zlib/zutil.c", - ] -} - config("libpng_public") { include_dirs = [ "libpng" ] } diff --git a/third_party/third_party.gni b/third_party/third_party.gni new file mode 100644 index 0000000000..813ee385f3 --- /dev/null +++ b/third_party/third_party.gni @@ -0,0 +1,15 @@ +# Copyright 2016 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { +} + +# Chrome's GN environment sets up a bunch of default configs we don't need/want here. +unwanted_configs = [ + "//build/config/clang:extra_warnings", + "//build/config/clang:find_bad_constructs", + "//build/config/compiler:chromium_code", + "//build/config:feature_flags", +] diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn new file mode 100644 index 0000000000..0fff083a43 --- /dev/null +++ b/third_party/zlib/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright 2016 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("../third_party.gni") + +config("zlib_public") { + include_dirs = [ "../externals/zlib" ] +} +source_set("zlib") { + public_configs = [ ":zlib_public" ] + configs -= unwanted_configs + + cflags = [ "-w" ] + + sources = [ + "../externals/zlib/adler32.c", + "../externals/zlib/compress.c", + "../externals/zlib/crc32.c", + "../externals/zlib/deflate.c", + "../externals/zlib/gzclose.c", + "../externals/zlib/gzlib.c", + "../externals/zlib/gzread.c", + "../externals/zlib/gzwrite.c", + "../externals/zlib/infback.c", + "../externals/zlib/inffast.c", + "../externals/zlib/inflate.c", + "../externals/zlib/inftrees.c", + "../externals/zlib/simd_stub.c", + "../externals/zlib/trees.c", + "../externals/zlib/uncompr.c", + "../externals/zlib/zutil.c", + ] +} |