diff options
author | Evan Martin <martine@danga.com> | 2011-05-13 15:53:02 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-13 23:28:07 (GMT) |
commit | 1c80bd1691f69332a8fec42080c1c341c0e2fa44 (patch) | |
tree | fd73c9d72997316fdc7b02f08ba6820784d790af /src/ninja.cc | |
parent | e2543e423499f2d9619941e33276ae1240fb2b91 (diff) | |
download | Ninja-1c80bd1691f69332a8fec42080c1c341c0e2fa44.zip Ninja-1c80bd1691f69332a8fec42080c1c341c0e2fa44.tar.gz Ninja-1c80bd1691f69332a8fec42080c1c341c0e2fa44.tar.bz2 |
make browse work for all ninja paths
Pass the path to the ninja binary in to the Python script.
Confusingly, in some places the variables were already in place
to do this, but they were accidentally used for something else
entirely.
Diffstat (limited to 'src/ninja.cc')
-rw-r--r-- | src/ninja.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ninja.cc b/src/ninja.cc index 8b4206c..ee76fb3 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -182,13 +182,14 @@ int CmdQuery(State* state, int argc, char* argv[]) { return 0; } -int CmdBrowse(State* state, int argc, char* argv[]) { +int CmdBrowse(State* state, const char* ninja_command, + int argc, char* argv[]) { #ifndef WIN32 if (argc < 1) { Error("expected a target to browse"); return 1; } - RunBrowsePython(state, argv[0]); + RunBrowsePython(state, ninja_command, argv[0]); #else Error("browse mode not yet supported on Windows"); #endif @@ -343,6 +344,7 @@ int CmdClean(State* state, } // anonymous namespace int main(int argc, char** argv) { + const char* ninja_command = argv[0]; BuildConfig config; const char* input_file = "build.ninja"; const char* working_dir = 0; @@ -411,7 +413,7 @@ int main(int argc, char** argv) { if (tool == "query") return CmdQuery(&state, argc, argv); if (tool == "browse") - return CmdBrowse(&state, argc, argv); + return CmdBrowse(&state, ninja_command, argc, argv); if (tool == "targets") return CmdTargets(&state, argc, argv); if (tool == "rules") |