X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=inline;f=source%2Flib%2Ftarget.h;h=1ae268cce54b5c7096c48aa6d9c8a7a665e50785;hb=6ce67e1469bf62156ddf64e33644851f9064c6ed;hp=6ef6457a0f5fe73d70ddc31d7f66b561e878b63b;hpb=c8e829c219c65ff8e93b6c7b66212ff0876441c5;p=builder.git diff --git a/source/lib/target.h b/source/lib/target.h index 6ef6457..1ae268c 100644 --- a/source/lib/target.h +++ b/source/lib/target.h @@ -6,7 +6,9 @@ #include #include #include +#include #include +#include "libbuilder_api.h" class Builder; class BuildInfo; @@ -24,7 +26,7 @@ normal and transitive. Normal dependencies will need to be built before the target itself, and will cause the target to be rebuilt if modified. Transitive dependencies can be used by other targets further down the chain. */ -class Target +class LIBBUILDER_API Target { public: using Dependencies = std::vector; @@ -40,6 +42,12 @@ protected: BROKEN }; + struct PushPrepare: Msp::NonCopyable + { + PushPrepare(Target *t) { prepare_stack.push_back(t); } + ~PushPrepare() { prepare_stack.pop_back(); } + }; + public: sigc::signal signal_bubble_rebuild; sigc::signal signal_modified; @@ -60,6 +68,8 @@ protected: Dependencies side_effects; Target *primary_target = 0; + static std::vector prepare_stack; + Target(Builder &, const std::string &); public: virtual ~Target() { }