aboutsummaryrefslogtreecommitdiff
path: root/include/ninja
diff options
context:
space:
mode:
Diffstat (limited to 'include/ninja')
-rw-r--r--include/ninja/Ninja.hpp9
1 files changed, 6 insertions, 3 deletions
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<ninja::NinjaArgValue> &additionalArgs);
+ NinjaBuild* build(const std::string &in, const std::string &out, const std::vector<ninja::NinjaArgValue> &additionalArgs, const std::vector<NinjaBuild*> &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<ninja::NinjaArgValue> additionalArgs;
+ const std::vector<NinjaBuild*> 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<NinjaArg> &commandArgs);
- void build(const NinjaRule *rule, const std::string &in, const std::string &out, const std::vector<ninja::NinjaArgValue> &additionalArgs);
+ NinjaBuild* build(const NinjaRule *rule, const std::string &in, const std::string &out, const std::vector<ninja::NinjaArgValue> &additionalArgs, const std::vector<NinjaBuild*> &dependsOnBuilds = {});
std::string generate() const;
private:
std::unordered_map<std::string, std::string> globalVariables;
std::unordered_map<std::string, NinjaRule*> rules;
- std::vector<NinjaBuild> builds;
+ std::vector<NinjaBuild*> builds;
};
} \ No newline at end of file