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

Unified Diff: tools/gn/target.h

Issue 1607423002: Allow .o files for GN generated inputs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix Created 4 years, 11 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/ninja_target_writer.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 eff4d150d53e5dd3a7856926c3ab0ed7d6925f3a..cbdab35761ef8e77c545921b5e958743b271951b 100644
--- a/tools/gn/target.h
+++ b/tools/gn/target.h
@@ -21,6 +21,7 @@
#include "tools/gn/ordered_set.h"
#include "tools/gn/output_file.h"
#include "tools/gn/source_file.h"
+#include "tools/gn/toolchain.h"
#include "tools/gn/unique_vector.h"
class DepsIteratorRange;
@@ -66,6 +67,10 @@ class Target : public Item {
OutputType output_type() const { return output_type_; }
void set_output_type(OutputType t) { output_type_ = t; }
+ // True for targets that compile source code (all types of libaries and
+ // executables).
+ bool IsBinary() const;
+
// Can be linked into other targets.
bool IsLinkable() const;
@@ -245,6 +250,18 @@ class Target : public Item {
return dependency_output_file_;
}
+ // Computes the set of output files resulting from compiling the given source
+ // file. If the file can be compiled and the tool exists, fills the outputs
+ // in and writes the tool type to computed_tool_type. If the file is not
+ // compilable, returns false.
+ //
+ // The function can succeed with a "NONE" tool type for object files which
+ // are just passed to the output. The output will always be overwritten, not
+ // appended to.
+ bool GetOutputFilesForSource(const SourceFile& source,
+ Toolchain::ToolType* computed_tool_type,
+ std::vector<OutputFile>* outputs) const;
+
private:
FRIEND_TEST_ALL_PREFIXES(Target, ResolvePrecompiledHeaders);
« no previous file with comments | « tools/gn/ninja_target_writer.cc ('k') | tools/gn/target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698