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

Unified Diff: tools/gn/runtime_deps.cc

Issue 1155303008: Allow directories for GN data lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@path
Patch Set: add dir test Created 5 years, 7 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 | « tools/gn/output_file.cc ('k') | tools/gn/runtime_deps_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/runtime_deps.cc
diff --git a/tools/gn/runtime_deps.cc b/tools/gn/runtime_deps.cc
index a8dfb0bafef1864ff5159136e4c63ae0570275c1..097044f7328cccd7dd09d7da9c66dd5a1751e15c 100644
--- a/tools/gn/runtime_deps.cc
+++ b/tools/gn/runtime_deps.cc
@@ -36,13 +36,16 @@ void AddIfNew(const OutputFile& output_file,
deps->push_back(std::make_pair(output_file, source));
}
-// Automatically converts a SourceFile to an OutputFile.
-void AddIfNew(const SourceFile& source_file,
+// Automatically converts a string that looks like a source to an OutputFile.
+void AddIfNew(const std::string& str,
const Target* source,
RuntimeDepsVector* deps,
std::set<OutputFile>* found_file) {
- AddIfNew(OutputFile(source->settings()->build_settings(), source_file),
- source, deps, found_file);
+ OutputFile output_file(RebasePath(
+ str,
+ source->settings()->build_settings()->build_dir(),
+ source->settings()->build_settings()->root_path_utf8()));
+ AddIfNew(output_file, source, deps, found_file);
}
// Returns the output file that the runtime deps considers for the given
@@ -82,7 +85,7 @@ void RecursiveCollectRuntimeDeps(const Target* target,
std::vector<SourceFile> outputs;
target->action_values().GetOutputsAsSourceFiles(target, &outputs);
for (const auto& output_file : outputs)
- AddIfNew(output_file, target, deps, found_files);
+ AddIfNew(output_file.value(), target, deps, found_files);
}
// Non-data dependencies (both public and private).
@@ -132,9 +135,9 @@ const char kRuntimeDeps_Help[] =
" (see \"gn help --runtime-deps-list-file\").\n"
"\n"
" To a first approximation, the runtime dependencies of a target are\n"
- " the set of \"data\" files and the shared libraries from all transitive\n"
- " dependencies. Executables and shared libraries are considered runtime\n"
- " dependencies of themselves.\n"
+ " the set of \"data\" files, data directories, and the shared libraries\n"
+ " from all transitive dependencies. Executables and shared libraries are\n"
+ " considered runtime dependencies of themselves.\n"
"\n"
"Details\n"
"\n"
« no previous file with comments | « tools/gn/output_file.cc ('k') | tools/gn/runtime_deps_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698