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

Unified Diff: tools/gn/target.h

Issue 1868023002: Add GN output prefix override and allow empty output extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/substitution_writer_unittest.cc ('k') | tools/gn/target.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target.h
diff --git a/tools/gn/target.h b/tools/gn/target.h
index c3fed0122523b96d60805f00aa211bb5d2521d38..fdd6f1a682164aeb758b4e707fbfd3aac705e807 100644
--- a/tools/gn/target.h
+++ b/tools/gn/target.h
@@ -89,16 +89,29 @@ class Target : public Item {
void set_output_name(const std::string& name) { output_name_ = name; }
// Returns the output name for this target, which is the output_name if
- // specified, or the target label if not. If the flag is set, it will also
- // include any output prefix specified on the tool (often "lib" on Linux).
+ // specified, or the target label if not.
//
// Because this depends on the tool for this target, the toolchain must
// have been set before calling.
- std::string GetComputedOutputName(bool include_prefix) const;
+ std::string GetComputedOutputName() const;
+ bool output_prefix_override() const { return output_prefix_override_; }
+ void set_output_prefix_override(bool prefix_override) {
+ output_prefix_override_ = prefix_override;
+ }
+
+ // The output extension is really a tri-state: unset (output_extension_set
+ // is false and the string is empty, meaning the default extension should be
+ // used), the output extension is set but empty (output should have no
+ // extension) and the output extension is set but nonempty (use the given
+ // extension).
const std::string& output_extension() const { return output_extension_; }
void set_output_extension(const std::string& extension) {
output_extension_ = extension;
+ output_extension_set_ = true;
+ }
+ bool output_extension_set() const {
+ return output_extension_set_;
}
const FileList& sources() const { return sources_; }
@@ -318,7 +331,9 @@ class Target : public Item {
OutputType output_type_;
std::string output_name_;
+ bool output_prefix_override_;
std::string output_extension_;
+ bool output_extension_set_;
FileList sources_;
bool all_headers_public_;
« no previous file with comments | « tools/gn/substitution_writer_unittest.cc ('k') | tools/gn/target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698