summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2010-12-20 00:03:55 (GMT)
committerEvan Martin <martine@danga.com>2010-12-20 00:03:55 (GMT)
commit4ec6e5337ae6d7dc5f69e6407b488faf23439193 (patch)
treecb468cb1006fd361282a7a95d5faf83a05bbf8a6
parent6f2a2ce9760cfab7ce570104892688385347d102 (diff)
downloadNinja-4ec6e5337ae6d7dc5f69e6407b488faf23439193.zip
Ninja-4ec6e5337ae6d7dc5f69e6407b488faf23439193.tar.gz
Ninja-4ec6e5337ae6d7dc5f69e6407b488faf23439193.tar.bz2
restore gyp root hack
-rw-r--r--src/parsers.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/parsers.cc b/src/parsers.cc
index af5446e..8408195 100644
--- a/src/parsers.cc
+++ b/src/parsers.cc
@@ -256,6 +256,15 @@ bool ManifestParser::Parse(const string& input, string* err) {
string name, value;
if (!ParseLet(&name, &value, err))
return false;
+ if (value.substr(0, 9) == "ROOT_HACK") {
+ // XXX remove this hack, or make it more principled.
+ char cwd[1024];
+ if (!getcwd(cwd, sizeof(cwd))) {
+ perror("getcwd");
+ return 1;
+ }
+ value = cwd + value.substr(9);
+ }
env_->AddBinding(name, value);
break;
}