X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flib%2Ftarget.h;h=c6c8baa89d6e5046001afbf4ffb8c3c628316e99;hb=HEAD;hp=0ba38f82031b06122aa10c001f222e0bbf143c49;hpb=1df42c314669f30fe1d82f02fdfeeff19f92964e;p=builder.git diff --git a/source/lib/target.h b/source/lib/target.h index 0ba38f8..c6c8baa 100644 --- a/source/lib/target.h +++ b/source/lib/target.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "libbuilder_api.h" @@ -41,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 +67,9 @@ protected: Dependencies trans_depends; Dependencies side_effects; Target *primary_target = 0; + bool rescan_trans_deps = false; + + static std::vector prepare_stack; Target(Builder &, const std::string &); public: @@ -87,6 +97,13 @@ protected: direct dependencies first. */ virtual void find_dependencies() { } +private: + bool find_transitive_dependencies(); + void find_transitive_dependencies(Target &, std::vector &) const; + +protected: + virtual Target *resolve_transitive_dependency(Target &, Target &dep) const { return &dep; } + public: /// Returns the dependencies of the target, in the order they were added. const Dependencies &get_dependencies() const { return depends; }