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

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

Issue 1207903002: Windows precompiled header support in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Scott's grammar nits Created 5 years, 5 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
« no previous file with comments | « tools/gn/config_values_generator.cc ('k') | tools/gn/function_toolchain.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/filesystem_utils.h" 5 #include "tools/gn/filesystem_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 const SourceDir& source_dir) { 737 const SourceDir& source_dir) {
738 OutputFile result = settings->toolchain_output_subdir(); 738 OutputFile result = settings->toolchain_output_subdir();
739 result.value().append("obj/"); 739 result.value().append("obj/");
740 740
741 if (source_dir.is_source_absolute()) { 741 if (source_dir.is_source_absolute()) {
742 // The source dir is source-absolute, so we trim off the two leading 742 // The source dir is source-absolute, so we trim off the two leading
743 // slashes to append to the toolchain object directory. 743 // slashes to append to the toolchain object directory.
744 result.value().append(&source_dir.value()[2], 744 result.value().append(&source_dir.value()[2],
745 source_dir.value().size() - 2); 745 source_dir.value().size() - 2);
746 } else { 746 } else {
747 // system-absolute 747 // System-absolute.
748 const std::string& build_dir = 748 const std::string& build_dir =
749 settings->build_settings()->build_dir().value(); 749 settings->build_settings()->build_dir().value();
750 750
751 if (base::StartsWithASCII(source_dir.value(), build_dir, true)) { 751 if (base::StartsWithASCII(source_dir.value(), build_dir, true)) {
752 size_t build_dir_size = build_dir.size(); 752 size_t build_dir_size = build_dir.size();
753 result.value().append(&source_dir.value()[build_dir_size], 753 result.value().append(&source_dir.value()[build_dir_size],
754 source_dir.value().size() - build_dir_size); 754 source_dir.value().size() - build_dir_size);
755 } else { 755 } else {
756 result.value().append("ABS_PATH"); 756 result.value().append("ABS_PATH");
757 #if defined(OS_WIN) 757 #if defined(OS_WIN)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 813
814 SourceDir GetCurrentOutputDir(const Scope* scope) { 814 SourceDir GetCurrentOutputDir(const Scope* scope) {
815 return GetOutputDirForSourceDirAsOutputFile( 815 return GetOutputDirForSourceDirAsOutputFile(
816 scope->settings(), scope->GetSourceDir()).AsSourceDir( 816 scope->settings(), scope->GetSourceDir()).AsSourceDir(
817 scope->settings()->build_settings()); 817 scope->settings()->build_settings());
818 } 818 }
819 819
820 SourceDir GetCurrentGenDir(const Scope* scope) { 820 SourceDir GetCurrentGenDir(const Scope* scope) {
821 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir()); 821 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir());
822 } 822 }
OLDNEW
« no previous file with comments | « tools/gn/config_values_generator.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698