Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: tools/gn/ninja_build_writer.cc

Issue 128693003: GN: Use path service to find executable path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_build_writer.cc
diff --git a/tools/gn/ninja_build_writer.cc b/tools/gn/ninja_build_writer.cc
index 510ee7f17243b14ec8afdef0ad4f41092ff72ca1..2fb0f1fc9c76adce4bcd9de1e15ab6134adf1ed0 100644
--- a/tools/gn/ninja_build_writer.cc
+++ b/tools/gn/ninja_build_writer.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/path_service.h"
#include "base/process/process_handle.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -26,24 +27,8 @@
namespace {
std::string GetSelfInvocationCommand(const BuildSettings* build_settings) {
-#if defined(OS_WIN)
- wchar_t module[MAX_PATH];
- GetModuleFileName(NULL, module, MAX_PATH);
- //result = "\"" + base::WideToUTF8(module) + "\"";
- base::FilePath executable(module);
-#elif defined(OS_MACOSX)
- // FIXME(brettw) write this on Mac!
- base::FilePath executable("../Debug/gn");
-#else
- base::FilePath executable =
- base::GetProcessExecutablePath(base::GetCurrentProcessHandle());
-#endif
-
-/*
- // Append the root path.
- CommandLine* cmdline = CommandLine::ForCurrentProcess();
- result += " --root=\"" + FilePathToUTF8(settings->root_path()) + "\"";
-*/
+ base::FilePath executable;
+ PathService::Get(base::FILE_EXE, &executable);
CommandLine cmdline(executable);
cmdline.AppendSwitchPath("--root", build_settings->root_path());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698