X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftarget.h;h=6ef6457a0f5fe73d70ddc31d7f66b561e878b63b;hb=d1f9551e05c9d341149eb490e05b1465d3d6b711;hp=114a51ec35ae934faf1ed89acdf9b99a749c9382;hpb=df88e22a258f169b9505acb0cb8d0ba7e66af7b6;p=builder.git diff --git a/source/target.h b/source/target.h index 114a51e..6ef6457 100644 --- a/source/target.h +++ b/source/target.h @@ -1,14 +1,15 @@ #ifndef TARGET_H_ #define TARGET_H_ -#include #include #include #include +#include #include #include class Builder; +class BuildInfo; class Component; class SourcePackage; class Task; @@ -26,7 +27,7 @@ dependencies can be used by other targets further down the chain. class Target { public: - typedef std::list Dependencies; + using Dependencies = std::vector; protected: enum State @@ -45,19 +46,19 @@ public: protected: Builder &builder; - const SourcePackage *package; - const Component *component; + const SourcePackage *package = 0; + const Component *component = 0; std::string name; - Tool *tool; - State state; + Tool *tool = 0; + State state = INIT; std::string rebuild_reason; - std::list problems; + std::vector problems; Dependencies depends; Dependencies trans_depends; Dependencies side_effects; - Target *primary_target; + Target *primary_target = 0; Target(Builder &, const std::string &); public: @@ -114,6 +115,8 @@ public: the build() function. */ const Tool *get_tool() const { return tool; } + virtual void collect_build_info(BuildInfo &) const; + /** Indicates if it's possible to build this target. */ bool is_buildable() const { return tool!=0; } @@ -138,7 +141,7 @@ protected: public: bool is_broken() const { return state==BROKEN; } - const std::list &get_problems() const { return problems; } + const std::vector &get_problems() const { return problems; } /** Prepares the target by finding dependencies, recursively preparing them and then checking whether rebuilding is needed. */