| Index: tools/gn/target.cc
|
| diff --git a/tools/gn/target.cc b/tools/gn/target.cc
|
| index 49a22fcbd8c4289e14623ebe2d39e8f68325f0a2..17cf492576302acf45367c169567f340fde03e0e 100644
|
| --- a/tools/gn/target.cc
|
| +++ b/tools/gn/target.cc
|
| @@ -138,6 +138,8 @@ const char* Target::GetStringForOutputType(OutputType type) {
|
| return "Source set";
|
| case COPY_FILES:
|
| return "Copy";
|
| + case COPY_BUNDLE_DATA:
|
| + return "Copy bundle data";
|
| case ACTION:
|
| return "Action";
|
| case ACTION_FOREACH:
|
| @@ -195,6 +197,7 @@ bool Target::OnResolved(Err* err) {
|
| all_libs_.append(cur.libs().begin(), cur.libs().end());
|
| }
|
|
|
| + PullRecursiveBundleData();
|
| PullDependentTargetLibs();
|
| PullRecursiveHardDeps();
|
| if (!ResolvePrecompiledHeaders(err))
|
| @@ -226,6 +229,7 @@ bool Target::IsFinal() const {
|
| output_type_ == ACTION ||
|
| output_type_ == ACTION_FOREACH ||
|
| output_type_ == COPY_FILES ||
|
| + output_type_ == COPY_BUNDLE_DATA ||
|
| (output_type_ == STATIC_LIBRARY && complete_static_lib_);
|
| }
|
|
|
| @@ -356,6 +360,27 @@ void Target::PullRecursiveHardDeps() {
|
| }
|
| }
|
|
|
| +void Target::PullRecursiveBundleData() {
|
| + for (const auto& pair : GetDeps(DEPS_LINKED)) {
|
| + if (pair.ptr->output_type() == EXECUTABLE ||
|
| + pair.ptr->output_type() == SHARED_LIBRARY ||
|
| + pair.ptr->output_type() == LOADABLE_MODULE ||
|
| + pair.ptr->output_type() == COPY_BUNDLE_DATA)
|
| + continue;
|
| +
|
| + bundle_data_.insert(pair.ptr->bundle_data().begin(),
|
| + pair.ptr->bundle_data().end());
|
| + }
|
| +
|
| + if (output_type_ != COPY_BUNDLE_DATA)
|
| + return;
|
| +
|
| + // TODO(sdefresne): .xcasset needs to have a specific treatment. This will
|
| + // requires a second target using the "bundle_data" information, and for a
|
| + // way to filter out .xcasset from "copy_bundle_data".
|
| + sources_.insert(sources_.end(), bundle_data_.begin(), bundle_data_.end());
|
| +}
|
| +
|
| void Target::FillOutputFiles() {
|
| const Tool* tool = toolchain_->GetToolForTargetFinalOutput(this);
|
| bool check_tool_outputs = false;
|
| @@ -363,6 +388,7 @@ void Target::FillOutputFiles() {
|
| case GROUP:
|
| case SOURCE_SET:
|
| case COPY_FILES:
|
| + case COPY_BUNDLE_DATA:
|
| case ACTION:
|
| case ACTION_FOREACH: {
|
| // These don't get linked to and use stamps which should be the first
|
|
|