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

Unified Diff: BUILD.gn

Issue 2292343003: GN: add sources_when_disabled to optional (Closed)
Patch Set: 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 | tools/fiddle/fiddle_main.cpp » ('j') | 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 446345b5eb163f8e21d45ac0a6fa421ec1ad8802..c86315ddd5a0511a0789b1c03e693dc953198731 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -239,15 +239,21 @@ opts("dsp") {
template("optional") {
if (invoker.enabled) {
config(target_name + "_public") {
- defines = invoker.public_defines
+ if (defined(invoker.public_defines)) {
+ defines = invoker.public_defines
+ }
}
source_set(target_name) {
- forward_variables_from(invoker, "*", [ "public_defines" ])
+ forward_variables_from(invoker,
+ "*",
+ [
+ "public_defines",
+ "sources_when_disabled",
+ ])
all_dependent_configs = [ ":" + target_name + "_public" ]
configs += skia_library_configs
}
} else {
- # If not enabled, a phony empty target that swallows all otherwise unused variables.
source_set(target_name) {
forward_variables_from(invoker,
"*",
@@ -255,14 +261,18 @@ template("optional") {
"public_defines",
"deps",
"sources",
+ "sources_when_disabled",
])
+ if (defined(invoker.sources_when_disabled)) {
+ sources = invoker.sources_when_disabled
+ }
+ configs += skia_library_configs
}
}
}
optional("fontmgr_android") {
enabled = fontmgr_android_enabled
- public_defines = []
deps = [
"//third_party/expat",
@@ -277,7 +287,6 @@ optional("fontmgr_android") {
optional("fontmgr_fontconfig") {
enabled = skia_use_freetype && skia_use_fontconfig
- public_defines = []
deps = [
"//third_party:fontconfig",
@@ -322,16 +331,16 @@ optional("jpeg") {
optional("pdf") {
enabled = skia_use_zlib
- public_defines = []
deps = [
"//third_party/zlib",
]
sources = pdf_gypi.sources
+ sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
if (skia_use_sfntly) {
deps += [ "//third_party/sfntly" ]
- public_defines += [ "SK_PDF_USE_SFNTLY" ]
+ public_defines = [ "SK_PDF_USE_SFNTLY" ]
}
}
@@ -351,7 +360,6 @@ optional("png") {
optional("typeface_freetype") {
enabled = skia_use_freetype
- public_defines = []
deps = [
"//third_party/freetype2",
@@ -378,7 +386,6 @@ optional("webp") {
optional("xml") {
enabled = skia_use_expat
- public_defines = []
deps = [
"//third_party/expat",
« no previous file with comments | « no previous file | tools/fiddle/fiddle_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698