diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-09-11 21:50:04 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-09-11 21:50:04 (GMT) |
commit | 35bababd78b3d6ca96c9ffeee2f98123dd280017 (patch) | |
tree | 2172945e24d3a4a1df6758794f3691363a3e18c6 /src | |
parent | e36590b781d956acf9711da311d0934471f95643 (diff) | |
parent | cc89c1aaec13487dc633cd69f7022fcb72fc1c10 (diff) | |
download | Ninja-35bababd78b3d6ca96c9ffeee2f98123dd280017.zip Ninja-35bababd78b3d6ca96c9ffeee2f98123dd280017.tar.gz Ninja-35bababd78b3d6ca96c9ffeee2f98123dd280017.tar.bz2 |
Merge pull request #657 from sgraham/keeprsp2
add -d keeprsp to preserve @rsp files on success on windows
Diffstat (limited to 'src')
-rw-r--r-- | src/build.cc | 3 | ||||
-rw-r--r-- | src/debug_flags.cc (renamed from src/explain.cc) | 2 | ||||
-rw-r--r-- | src/debug_flags.h (renamed from src/explain.h) | 2 | ||||
-rw-r--r-- | src/graph.cc | 2 | ||||
-rw-r--r-- | src/ninja.cc | 6 |
5 files changed, 12 insertions, 3 deletions
diff --git a/src/build.cc b/src/build.cc index 8a93632..9718f85 100644 --- a/src/build.cc +++ b/src/build.cc @@ -25,6 +25,7 @@ #endif #include "build_log.h" +#include "debug_flags.h" #include "depfile_parser.h" #include "deps_log.h" #include "disk_interface.h" @@ -776,7 +777,7 @@ bool Builder::FinishCommand(CommandRunner::Result* result, string* err) { // Delete any left over response file. string rspfile = edge->GetBinding("rspfile"); - if (!rspfile.empty()) + if (!rspfile.empty() && !g_keep_rsp) disk_interface_->RemoveFile(rspfile); if (scan_.build_log()) { diff --git a/src/explain.cc b/src/debug_flags.cc index 4e14c25..75f1ea5 100644 --- a/src/explain.cc +++ b/src/debug_flags.cc @@ -13,3 +13,5 @@ // limitations under the License. bool g_explaining = false; + +bool g_keep_rsp = false; diff --git a/src/explain.h b/src/debug_flags.h index d4f6a6c..ba3ebf3 100644 --- a/src/explain.h +++ b/src/debug_flags.h @@ -24,4 +24,6 @@ extern bool g_explaining; +extern bool g_keep_rsp; + #endif // NINJA_EXPLAIN_H_ diff --git a/src/graph.cc b/src/graph.cc index 6191998..9801a7b 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -18,10 +18,10 @@ #include <stdio.h> #include "build_log.h" +#include "debug_flags.h" #include "depfile_parser.h" #include "deps_log.h" #include "disk_interface.h" -#include "explain.h" #include "manifest_parser.h" #include "metrics.h" #include "state.h" diff --git a/src/ninja.cc b/src/ninja.cc index 0586bdc..a313ecb 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -32,8 +32,8 @@ #include "build_log.h" #include "deps_log.h" #include "clean.h" +#include "debug_flags.h" #include "disk_interface.h" -#include "explain.h" #include "graph.h" #include "graphviz.h" #include "manifest_parser.h" @@ -747,6 +747,7 @@ bool DebugEnable(const string& name) { printf("debugging modes:\n" " stats print operation counts/timing info\n" " explain explain what caused a command to execute\n" +" keeprsp don't delete @response files on success\n" "multiple modes can be enabled via -d FOO -d BAR\n"); return false; } else if (name == "stats") { @@ -755,6 +756,9 @@ bool DebugEnable(const string& name) { } else if (name == "explain") { g_explaining = true; return true; + } else if (name == "keeprsp") { + g_keep_rsp = true; + return true; } else { const char* suggestion = SpellcheckString(name.c_str(), "stats", "explain", NULL); |