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

Unified Diff: tools/gn/function_process_file_template.cc

Issue 2387763002: Support for source_target_relative expansion in GN (Closed)
Patch Set: Rebased Created 4 years, 1 month 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/docs/reference.md ('k') | tools/gn/ninja_action_target_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_process_file_template.cc
diff --git a/tools/gn/function_process_file_template.cc b/tools/gn/function_process_file_template.cc
index 78889c98fd8009b3a5ee8178ebc1101b9fec214d..28e3e4683c6407db0783dcbebb39f723b11fb34d 100644
--- a/tools/gn/function_process_file_template.cc
+++ b/tools/gn/function_process_file_template.cc
@@ -93,8 +93,15 @@ Value RunProcessFileTemplate(Scope* scope,
return Value();
}
+ auto& types = subst.required_types();
+ if (std::find(types.begin(), types.end(),
+ SUBSTITUTION_SOURCE_TARGET_RELATIVE) != types.end()) {
+ *err = Err(template_arg, "Not a valid substitution type for the function.");
+ return Value();
+ }
+
SubstitutionWriter::ApplyListToSourcesAsString(
- scope->settings(), subst, input_files, &result_files);
+ nullptr, scope->settings(), subst, input_files, &result_files);
// Convert the list of strings to the return Value.
Value ret(function, Value::LIST);
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/ninja_action_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698