summaryrefslogtreecommitdiffstats
path: root/src/graph.h
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2014-05-21 22:07:47 (GMT)
committerNico Weber <thakis@chromium.org>2014-05-21 22:18:01 (GMT)
commitbc239cca4f3f0757ba34d0306fbc2a2b75d067a2 (patch)
treee01abd5130c1e0f7ecca0dc0f0a24e8b9113dc0f /src/graph.h
parent7103c32646df958b0287c65b1c660bf528a191d6 (diff)
downloadNinja-bc239cca4f3f0757ba34d0306fbc2a2b75d067a2.zip
Ninja-bc239cca4f3f0757ba34d0306fbc2a2b75d067a2.tar.gz
Ninja-bc239cca4f3f0757ba34d0306fbc2a2b75d067a2.tar.bz2
Make "depfile=$out.d" work if $out contains escaped characters, rspfile too.
Fixes #730. This has always been broken, but due to #690 more paths are now escaped (e.g. paths containing + characters, like file.c++). Also see discussion in #689. The approach is to give EdgeEnv an enum deciding on whether or not to escape file names, and provide functions that evaluate depfile and rspfile with that set that to kNoEscape. (depfile=$out.d doesn't make sense on edges with multiple outputs.) This should be relatively safe, as $in and $out can't be used on edges, only on rules (#687).
Diffstat (limited to 'src/graph.h')
-rw-r--r--src/graph.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/graph.h b/src/graph.h
index 6cd7f25..66e31b5 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -146,9 +146,15 @@ struct Edge {
/// full contents of a response file (if applicable)
string EvaluateCommand(bool incl_rsp_file = false);
+ /// Returns the shell-escaped value of |key|.
string GetBinding(const string& key);
bool GetBindingBool(const string& key);
+ /// Like GetBinding("depfile"), but without shell escaping.
+ string GetUnescapedDepfile();
+ /// Like GetBinding("rspfile"), but without shell escaping.
+ string GetUnescapedRspfile();
+
void Dump(const char* prefix="") const;
const Rule* rule_;