Index: build/config/BUILDCONFIG.gn |
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn |
index b88619da6aeb5b424699b6b07303043869d7996b..a71b4e2bd1334ea8427d0d8f93f3e36770259288 100644 |
--- a/build/config/BUILDCONFIG.gn |
+++ b/build/config/BUILDCONFIG.gn |
@@ -604,7 +604,9 @@ if (is_win) { |
# COMPONENT SETUP |
# ============================================================================== |
-# TODO(brettw) erase this once the built-in "component" function is removed. |
+# TODO(brettw): Convert component_mode to being a non-exported variable |
+# ("_component_mode" instead) once ICU's BUILD.gn file is updated to use |
+# is_component_build instead. |
if (is_component_build) { |
component_mode = "shared_library" |
} else { |
@@ -612,192 +614,14 @@ if (is_component_build) { |
} |
template("component") { |
- if (is_component_build) { |
- shared_library(target_name) { |
- # Configs will always be defined since we set_defaults for a component |
- # above. We want to use those rather than whatever came with the nested |
- # shared/static library inside the component. |
- configs = [] # Prevent list overwriting warning. |
- configs = invoker.configs |
- |
- # The sources assignment filter will have already been applied when the |
- # code was originally executed. We don't want to apply it again, since |
- # the original target may have override it for some assignments. |
- set_sources_assignment_filter([]) |
- |
- if (defined(invoker.all_dependent_configs)) { |
- all_dependent_configs = invoker.all_dependent_configs |
- } |
- if (defined(invoker.allow_circular_includes_from)) { |
- allow_circular_includes_from = invoker.allow_circular_includes_from |
- } |
- if (defined(invoker.cflags)) { |
- cflags = invoker.cflags |
- } |
- if (defined(invoker.cflags_c)) { |
- cflags_c = invoker.cflags_c |
- } |
- if (defined(invoker.cflags_cc)) { |
- cflags_cc = invoker.cflags_cc |
- } |
- if (defined(invoker.cflags_objc)) { |
- cflags_objc = invoker.cflags_objc |
- } |
- if (defined(invoker.cflags_objcc)) { |
- cflags_objcc = invoker.cflags_objcc |
- } |
- if (defined(invoker.check_includes)) { |
- check_includes = invoker.check_includes |
- } |
- if (defined(invoker.data)) { |
- data = invoker.data |
- } |
- if (defined(invoker.data_deps)) { |
- data_deps = invoker.data_deps |
- } |
- if (defined(invoker.datadeps)) { |
- datadeps = invoker.datadeps |
- } |
- if (defined(invoker.defines)) { |
- defines = invoker.defines |
- } |
- |
- # All shared libraries must have the sanitizer deps to properly link in |
- # asan mode (this target will be empty in other cases). |
- if (defined(invoker.deps)) { |
- deps = invoker.deps + [ "//build/config/sanitizers:deps" ] |
- } else { |
- deps = [ |
- "//build/config/sanitizers:deps", |
- ] |
- } |
- if (defined(invoker.forward_dependent_configs_from)) { |
- forward_dependent_configs_from = invoker.forward_dependent_configs_from |
- } |
- if (defined(invoker.include_dirs)) { |
- include_dirs = invoker.include_dirs |
- } |
- if (defined(invoker.ldflags)) { |
- ldflags = invoker.ldflags |
- } |
- if (defined(invoker.lib_dirs)) { |
- lib_dirs = invoker.lib_dirs |
- } |
- if (defined(invoker.libs)) { |
- libs = invoker.libs |
- } |
- if (defined(invoker.output_extension)) { |
- output_extension = invoker.output_extension |
- } |
- if (defined(invoker.output_name)) { |
- output_name = invoker.output_name |
- } |
- if (defined(invoker.public)) { |
- public = invoker.public |
- } |
- if (defined(invoker.public_configs)) { |
- public_configs = invoker.public_configs |
- } |
- if (defined(invoker.public_deps)) { |
- public_deps = invoker.public_deps |
- } |
- if (defined(invoker.sources)) { |
- sources = invoker.sources |
- } |
- if (defined(invoker.testonly)) { |
- testonly = invoker.testonly |
- } |
- if (defined(invoker.visibility)) { |
- visibility = invoker.visibility |
- } |
- } |
- } else { |
- source_set(target_name) { |
- # See above. |
- configs = [] # Prevent list overwriting warning. |
- configs = invoker.configs |
- |
- # See above call. |
- set_sources_assignment_filter([]) |
- |
- if (defined(invoker.all_dependent_configs)) { |
- all_dependent_configs = invoker.all_dependent_configs |
- } |
- if (defined(invoker.allow_circular_includes_from)) { |
- allow_circular_includes_from = invoker.allow_circular_includes_from |
- } |
- if (defined(invoker.cflags)) { |
- cflags = invoker.cflags |
- } |
- if (defined(invoker.cflags_c)) { |
- cflags_c = invoker.cflags_c |
- } |
- if (defined(invoker.cflags_cc)) { |
- cflags_cc = invoker.cflags_cc |
- } |
- if (defined(invoker.cflags_objc)) { |
- cflags_objc = invoker.cflags_objc |
- } |
- if (defined(invoker.cflags_objcc)) { |
- cflags_objcc = invoker.cflags_objcc |
- } |
- if (defined(invoker.check_includes)) { |
- check_includes = invoker.check_includes |
- } |
- if (defined(invoker.data)) { |
- data = invoker.data |
- } |
- if (defined(invoker.data_deps)) { |
- data_deps = invoker.data_deps |
- } |
- if (defined(invoker.datadeps)) { |
- datadeps = invoker.datadeps |
- } |
- if (defined(invoker.defines)) { |
- defines = invoker.defines |
- } |
- if (defined(invoker.deps)) { |
- deps = invoker.deps |
- } |
- if (defined(invoker.forward_dependent_configs_from)) { |
- forward_dependent_configs_from = invoker.forward_dependent_configs_from |
- } |
- if (defined(invoker.include_dirs)) { |
- include_dirs = invoker.include_dirs |
- } |
- if (defined(invoker.ldflags)) { |
- ldflags = invoker.ldflags |
- } |
- if (defined(invoker.lib_dirs)) { |
- lib_dirs = invoker.lib_dirs |
- } |
- if (defined(invoker.libs)) { |
- libs = invoker.libs |
- } |
- if (defined(invoker.output_extension)) { |
- output_extension = invoker.output_extension |
- } |
- if (defined(invoker.output_name)) { |
- output_name = invoker.output_name |
- } |
- if (defined(invoker.public)) { |
- public = invoker.public |
- } |
- if (defined(invoker.public_configs)) { |
- public_configs = invoker.public_configs |
- } |
- if (defined(invoker.public_deps)) { |
- public_deps = invoker.public_deps |
- } |
- if (defined(invoker.sources)) { |
- sources = invoker.sources |
- } |
- if (defined(invoker.testonly)) { |
- testonly = invoker.testonly |
- } |
- if (defined(invoker.visibility)) { |
- visibility = invoker.visibility |
- } |
+ target(component_mode, target_name) { |
Peng
2015/08/05 18:45:38
Build error for mandoline at this line.
ERROR at
|
+ forward_variables_from(invoker, "*") |
+ |
+ # All shared libraries must have the sanitizer deps to properly link in |
+ # asan mode (this target will be empty in other cases). |
+ if (!defined(deps)) { |
+ deps = [] |
} |
+ deps += [ "//build/config/sanitizers:deps" ] |
} |
} |