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

Side by Side Diff: tools/gn/ninja_build_writer.cc

Issue 165823003: GN: Change gen command syntax, support relative dirs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change in build file writing Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/ninja_build_writer.h" 5 #include "tools/gn/ninja_build_writer.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 13 matching lines...) Expand all
24 #include <windows.h> 24 #include <windows.h>
25 #endif 25 #endif
26 26
27 namespace { 27 namespace {
28 28
29 std::string GetSelfInvocationCommand(const BuildSettings* build_settings) { 29 std::string GetSelfInvocationCommand(const BuildSettings* build_settings) {
30 base::FilePath executable; 30 base::FilePath executable;
31 PathService::Get(base::FILE_EXE, &executable); 31 PathService::Get(base::FILE_EXE, &executable);
32 32
33 CommandLine cmdline(executable); 33 CommandLine cmdline(executable);
34 cmdline.AppendArg("gen");
35 cmdline.AppendArg(build_settings->build_dir().value());
34 cmdline.AppendSwitchPath("--root", build_settings->root_path()); 36 cmdline.AppendSwitchPath("--root", build_settings->root_path());
35 cmdline.AppendSwitch("-q"); // Don't write output. 37 cmdline.AppendSwitch("-q"); // Don't write output.
36 38
37 EscapeOptions escape_shell; 39 EscapeOptions escape_shell;
38 escape_shell.mode = ESCAPE_SHELL; 40 escape_shell.mode = ESCAPE_SHELL;
39 #if defined(OS_WIN) 41 #if defined(OS_WIN)
40 // The command line code quoting varies by platform. We have one string, 42 // The command line code quoting varies by platform. We have one string,
41 // possibly with spaces, that we want to quote. The Windows command line 43 // possibly with spaces, that we want to quote. The Windows command line
42 // quotes again, so we don't want quoting. The Posix one doesn't. 44 // quotes again, so we don't want quoting. The Posix one doesn't.
43 escape_shell.inhibit_quoting = true; 45 escape_shell.inhibit_quoting = true;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 all_rules.append(" $\n "); 192 all_rules.append(" $\n ");
191 all_rules.append(target_file.value()); 193 all_rules.append(target_file.value());
192 } 194 }
193 195
194 if (!all_rules.empty()) { 196 if (!all_rules.empty()) {
195 out_ << "\nbuild all: phony " << all_rules << std::endl; 197 out_ << "\nbuild all: phony " << all_rules << std::endl;
196 out_ << "default all" << std::endl; 198 out_ << "default all" << std::endl;
197 } 199 }
198 } 200 }
199 201
OLDNEW
« tools/gn/filesystem_utils.cc ('K') | « tools/gn/gn_main.cc ('k') | tools/gn/setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698