From a64df87aa0cb30d3bbc755fc97eb782388b35b77 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 23 Sep 2018 12:21:06 +0200 Subject: Add build depends --- include/ninja/Ninja.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/ninja/Ninja.hpp b/include/ninja/Ninja.hpp index e2b4ab5..d0e3d50 100644 --- a/include/ninja/Ninja.hpp +++ b/include/ninja/Ninja.hpp @@ -69,12 +69,14 @@ namespace ninja const std::string value; }; + class NinjaBuild; + // Functions throw NinjaException on failure class NinjaRule { public: NinjaRule(NinjaBuildFile *buildFile, const std::string &name, const std::string &command); - void build(const std::string &in, const std::string &out, const std::vector &additionalArgs); + NinjaBuild* build(const std::string &in, const std::string &out, const std::vector &additionalArgs, const std::vector &dependsOnBuilds = {}); const std::string name; const std::string command; @@ -89,6 +91,7 @@ namespace ninja const std::string in; const std::string out; const std::vector additionalArgs; + const std::vector dependsOnBuilds; }; // Functions throw NinjaException on failure @@ -99,12 +102,12 @@ namespace ninja void defineGlobalVariable(const std::string &name, const std::string &value); NinjaRule* createRule(const std::string &name, const std::vector &commandArgs); - void build(const NinjaRule *rule, const std::string &in, const std::string &out, const std::vector &additionalArgs); + NinjaBuild* build(const NinjaRule *rule, const std::string &in, const std::string &out, const std::vector &additionalArgs, const std::vector &dependsOnBuilds = {}); std::string generate() const; private: std::unordered_map globalVariables; std::unordered_map rules; - std::vector builds; + std::vector builds; }; } \ No newline at end of file -- cgit v1.2.3