Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: BUILD.gn

Issue 2270693004: GN: make libwebp an optional dependency (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nicer Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index 6b00f45558e4fb85c5a0ed98f9bdd58d3d6ead76..ccf2e6bfc223e386edc99bfc4fc914308a6829f3 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -4,6 +4,7 @@
# found in the LICENSE file.
declare_args() {
+ skia_use_libwebp = !is_fuchsia
}
skia_public_includes = [
@@ -64,7 +65,6 @@ config("skia_private") {
"SK_HAS_GIF_LIBRARY",
"SK_HAS_JPEG_LIBRARY",
"SK_HAS_PNG_LIBRARY",
- "SK_HAS_WEBP_LIBRARY",
# TODO(halcanary): make this the default; this is the value Android uses.
"SK_SFNTLY_SUBSETTER=\"sample/chromium/font_subsetter.h\"",
@@ -183,16 +183,37 @@ if (is_x86) {
}
}
+if (skia_use_libwebp) {
+ config("webp_config") {
+ defines = [ "SK_HAS_WEBP_LIBRARY" ]
+ }
+ source_set("webp") {
+ configs += skia_library_configs
+ all_dependent_configs = [ ":webp_config" ]
+ deps = [
+ "//third_party/libwebp",
+ ]
+ sources = [
+ "src/codec/SkWebpAdapterCodec.cpp",
+ "src/codec/SkWebpCodec.cpp",
+ "src/images/SkWEBPImageEncoder.cpp",
+ ]
+ }
+} else {
+ source_set("webp") {
+ }
+}
+
component("skia") {
public_configs = [ ":skia_public" ]
configs += skia_library_configs
deps = [
+ ":webp",
"//third_party/expat",
"//third_party/giflib",
"//third_party/libjpeg-turbo:libjpeg",
"//third_party/libpng",
- "//third_party/libwebp",
"//third_party/sfntly",
"//third_party/zlib",
]
@@ -240,15 +261,12 @@ component("skia") {
"src/codec/SkSampler.cpp",
"src/codec/SkSwizzler.cpp",
"src/codec/SkWbmpCodec.cpp",
- "src/codec/SkWebpAdapterCodec.cpp",
- "src/codec/SkWebpCodec.cpp",
"src/images/SkImageEncoder.cpp",
"src/images/SkImageEncoder_Factory.cpp",
"src/images/SkJPEGImageEncoder.cpp",
"src/images/SkJPEGWriteUtility.cpp",
"src/images/SkKTXImageEncoder.cpp",
"src/images/SkPNGImageEncoder.cpp",
- "src/images/SkWEBPImageEncoder.cpp",
"src/ports/SkDiscardableMemory_none.cpp",
"src/ports/SkGlobalInitialization_default.cpp",
"src/ports/SkImageGenerator_skia.cpp",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698