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

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

Issue 630223002: gn: Support build directories outside the source tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated patch set Created 6 years, 1 month 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
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_toolchain_writer.h" 5 #include "tools/gn/ninja_toolchain_writer.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/strings/stringize_macros.h" 10 #include "base/strings/stringize_macros.h"
(...skipping 14 matching lines...) Expand all
25 25
26 NinjaToolchainWriter::NinjaToolchainWriter( 26 NinjaToolchainWriter::NinjaToolchainWriter(
27 const Settings* settings, 27 const Settings* settings,
28 const Toolchain* toolchain, 28 const Toolchain* toolchain,
29 const std::vector<const Target*>& targets, 29 const std::vector<const Target*>& targets,
30 std::ostream& out) 30 std::ostream& out)
31 : settings_(settings), 31 : settings_(settings),
32 toolchain_(toolchain), 32 toolchain_(toolchain),
33 targets_(targets), 33 targets_(targets),
34 out_(out), 34 out_(out),
35 path_output_(settings_->build_settings()->build_dir(), ESCAPE_NINJA) { 35 path_output_(settings_->build_settings()->build_dir(),
36 settings_->build_settings()->root_path_utf8(),
37 ESCAPE_NINJA) {
36 } 38 }
37 39
38 NinjaToolchainWriter::~NinjaToolchainWriter() { 40 NinjaToolchainWriter::~NinjaToolchainWriter() {
39 } 41 }
40 42
41 void NinjaToolchainWriter::Run() { 43 void NinjaToolchainWriter::Run() {
42 WriteRules(); 44 WriteRules();
43 WriteSubninjas(); 45 WriteSubninjas();
44 } 46 }
45 47
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Write subninja commands for each generated target. 130 // Write subninja commands for each generated target.
129 for (size_t i = 0; i < targets_.size(); i++) { 131 for (size_t i = 0; i < targets_.size(); i++) {
130 OutputFile ninja_file(targets_[i]->settings()->build_settings(), 132 OutputFile ninja_file(targets_[i]->settings()->build_settings(),
131 GetNinjaFileForTarget(targets_[i])); 133 GetNinjaFileForTarget(targets_[i]));
132 out_ << "subninja "; 134 out_ << "subninja ";
133 path_output_.WriteFile(out_, ninja_file); 135 path_output_.WriteFile(out_, ninja_file);
134 out_ << std::endl; 136 out_ << std::endl;
135 } 137 }
136 out_ << std::endl; 138 out_ << std::endl;
137 } 139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698