aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksi Lindeman <dec05eba@protonmail.com>2018-11-25 15:24:08 +0100
committerAleksi Lindeman <dec05eba@protonmail.com>2018-11-25 15:24:08 +0100
commitaa58ac5fb18cedc2c97a4c86f1c10b10b2708099 (patch)
treebe8dd4908a08a367664e4c77a519eea282cdee8b
parent45e57bb16903902a39045fa5e49027d1b6c7af6d (diff)
Add option to always run build
-rw-r--r--include/ninja/Ninja.hpp3
-rw-r--r--src/Ninja.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/include/ninja/Ninja.hpp b/include/ninja/Ninja.hpp
index 3fed138..095c959 100644
--- a/include/ninja/Ninja.hpp
+++ b/include/ninja/Ninja.hpp
@@ -69,7 +69,7 @@ namespace ninja
const std::string value;
};
- class NinjaBuild;
+ struct NinjaBuild;
// Functions throw NinjaException on failure
class NinjaRule
@@ -94,6 +94,7 @@ namespace ninja
const std::string out;
const std::vector<ninja::NinjaArgValue> additionalArgs;
const std::vector<NinjaBuild*> dependsOnBuilds;
+ bool alwaysRun;
};
// Functions throw NinjaException on failure
diff --git a/src/Ninja.cpp b/src/Ninja.cpp
index 5470d2b..09df2c1 100644
--- a/src/Ninja.cpp
+++ b/src/Ninja.cpp
@@ -214,6 +214,8 @@ namespace ninja
result += "\n\n";
}
+ result += "build always: phony\n\n";
+
for(const NinjaBuild *build : builds)
{
result += "build ";
@@ -232,6 +234,9 @@ namespace ninja
}
}
+ if(build->alwaysRun)
+ result += " | always";
+
for(const NinjaArgValue &additionalArg : build->additionalArgs)
{
result += "\n ";