OLD | NEW |
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/setup.h" | 5 #include "tools/gn/setup.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 base::FilePath build_arg_file = | 369 base::FilePath build_arg_file = |
370 build_settings_.GetFullPath(GetBuildArgFile()); | 370 build_settings_.GetFullPath(GetBuildArgFile()); |
371 base::CreateDirectory(build_arg_file.DirName()); | 371 base::CreateDirectory(build_arg_file.DirName()); |
372 | 372 |
373 std::string contents = stream.str(); | 373 std::string contents = stream.str(); |
374 #if defined(OS_WIN) | 374 #if defined(OS_WIN) |
375 // Use Windows lineendings for this file since it will often open in | 375 // Use Windows lineendings for this file since it will often open in |
376 // Notepad which can't handle Unix ones. | 376 // Notepad which can't handle Unix ones. |
377 ReplaceSubstringsAfterOffset(&contents, 0, "\n", "\r\n"); | 377 ReplaceSubstringsAfterOffset(&contents, 0, "\n", "\r\n"); |
378 #endif | 378 #endif |
379 if (base::WriteFile(build_arg_file, contents.c_str(), contents.size()) == | 379 if (base::WriteFile(build_arg_file, contents.c_str(), |
380 -1) { | 380 static_cast<int>(contents.size())) == -1) { |
381 Err(Location(), "Args file could not be written.", | 381 Err(Location(), "Args file could not be written.", |
382 "The file is \"" + FilePathToUTF8(build_arg_file) + | 382 "The file is \"" + FilePathToUTF8(build_arg_file) + |
383 "\"").PrintToStdout(); | 383 "\"").PrintToStdout(); |
384 return false; | 384 return false; |
385 } | 385 } |
386 | 386 |
387 return true; | 387 return true; |
388 } | 388 } |
389 | 389 |
390 bool Setup::FillSourceDir(const CommandLine& cmdline) { | 390 bool Setup::FillSourceDir(const CommandLine& cmdline) { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 } | 591 } |
592 | 592 |
593 void DependentSetup::RunPreMessageLoop() { | 593 void DependentSetup::RunPreMessageLoop() { |
594 CommonSetup::RunPreMessageLoop(); | 594 CommonSetup::RunPreMessageLoop(); |
595 } | 595 } |
596 | 596 |
597 bool DependentSetup::RunPostMessageLoop() { | 597 bool DependentSetup::RunPostMessageLoop() { |
598 return CommonSetup::RunPostMessageLoop(); | 598 return CommonSetup::RunPostMessageLoop(); |
599 } | 599 } |
600 | 600 |
OLD | NEW |