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

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

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « tools/gn/generate_test_gn_data.cc ('k') | tools/gn/ninja_build_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gyp_target_writer.h" 5 #include "tools/gn/gyp_target_writer.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 24 matching lines...) Expand all
35 void GypTargetWriter::WriteFile(const SourceFile& gyp_file, 35 void GypTargetWriter::WriteFile(const SourceFile& gyp_file,
36 const std::vector<TargetGroup>& targets, 36 const std::vector<TargetGroup>& targets,
37 Err* err) { 37 Err* err) {
38 if (targets.empty()) 38 if (targets.empty())
39 return; 39 return;
40 const Settings* debug_settings = 40 const Settings* debug_settings =
41 targets[0].debug->item()->AsTarget()->settings(); 41 targets[0].debug->item()->AsTarget()->settings();
42 const BuildSettings* debug_build_settings = debug_settings->build_settings(); 42 const BuildSettings* debug_build_settings = debug_settings->build_settings();
43 43
44 base::FilePath gyp_file_path = debug_build_settings->GetFullPath(gyp_file); 44 base::FilePath gyp_file_path = debug_build_settings->GetFullPath(gyp_file);
45 file_util::CreateDirectory(gyp_file_path.DirName()); 45 base::CreateDirectory(gyp_file_path.DirName());
46 46
47 std::stringstream file; 47 std::stringstream file;
48 file << "# Generated by GN. Do not edit.\n\n"; 48 file << "# Generated by GN. Do not edit.\n\n";
49 file << "{\n"; 49 file << "{\n";
50 file << " 'skip_includes': 1,\n"; 50 file << " 'skip_includes': 1,\n";
51 51
52 if (debug_settings->IsMac()) { 52 if (debug_settings->IsMac()) {
53 // Global settings for make/ninja. This must match common.gypi :( 53 // Global settings for make/ninja. This must match common.gypi :(
54 file << " 'make_global_settings': [\n"; 54 file << " 'make_global_settings': [\n";
55 file << " ['CC', 'third_party/llvm-build/Release+Asserts/bin/clang'],\n"; 55 file << " ['CC', 'third_party/llvm-build/Release+Asserts/bin/clang'],\n";
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 // static 102 // static
103 std::ostream& GypTargetWriter::Indent(std::ostream& out, int spaces) { 103 std::ostream& GypTargetWriter::Indent(std::ostream& out, int spaces) {
104 const char kSpaces[81] = 104 const char kSpaces[81] =
105 " " 105 " "
106 " "; 106 " ";
107 CHECK(static_cast<size_t>(spaces) <= arraysize(kSpaces) - 1); 107 CHECK(static_cast<size_t>(spaces) <= arraysize(kSpaces) - 1);
108 out.write(kSpaces, spaces); 108 out.write(kSpaces, spaces);
109 return out; 109 return out;
110 } 110 }
OLDNEW
« no previous file with comments | « tools/gn/generate_test_gn_data.cc ('k') | tools/gn/ninja_build_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698