+ // The toolchain is only known once this target is resolved (all if its
+ // dependencies are known). They will be null until then. Generally, this can
+ // only be used during target writing.
+ const Toolchain* toolchain() const { return toolchain_; }
+
+ // Sets the toolchain. The toolchain must include a tool for this target
+ // or the error will be set and the function will return false. Unusually,
+ // this function's "err" output is optional since this is commonly used
+ // frequently by unit tests which become needlessly verbose.
+ bool SetToolchain(const Toolchain* toolchain, Err* err = NULL);
+
+ // Returns outputs from this target. The link output file is the one that
+ // other targets link to when they depend on this target. This will only be
+ // valid for libraries and will be empty for all other target types.
+ //
+ // The dependency output file is the file that should be used to express
+ // a dependency on this one. It could be the same as the link output file
+ // (this will be the case for static libraries). For shared libraries it
+ // could be the same or different than the link output file, depending on the
+ // system. For actions this will be the stamp file.
+ //
+ // These are only known once the target is resolved and will be empty before
+ // that. This is a cache of the files to prevent every target that depends on
+ // a given library from recomputing the same pattern.
+ const OutputFile& link_output_file() const {
+ return link_output_file_;
+ }
+ const OutputFile& dependency_output_file() const {
+ return dependency_output_file_;
+ }
+