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

Side by Side Diff: tools/gn/functions.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/functions.h" 5 #include "tools/gn/functions.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 Value RunImport(Scope* scope, 462 Value RunImport(Scope* scope,
463 const FunctionCallNode* function, 463 const FunctionCallNode* function,
464 const std::vector<Value>& args, 464 const std::vector<Value>& args,
465 Err* err) { 465 Err* err) {
466 if (!EnsureSingleStringArg(function, args, err)) 466 if (!EnsureSingleStringArg(function, args, err))
467 return Value(); 467 return Value();
468 468
469 const SourceDir& input_dir = scope->GetSourceDir(); 469 const SourceDir& input_dir = scope->GetSourceDir();
470 SourceFile import_file = 470 SourceFile import_file =
471 input_dir.ResolveRelativeFile(args[0].string_value()); 471 input_dir.ResolveRelativeFile(args[0].string_value(),
472 scope->settings()->build_settings()->root_path_utf8());
472 scope->settings()->import_manager().DoImport(import_file, function, 473 scope->settings()->import_manager().DoImport(import_file, function,
473 scope, err); 474 scope, err);
474 return Value(); 475 return Value();
475 } 476 }
476 477
477 // set_sources_assignment_filter ----------------------------------------------- 478 // set_sources_assignment_filter -----------------------------------------------
478 479
479 const char kSetSourcesAssignmentFilter[] = "set_sources_assignment_filter"; 480 const char kSetSourcesAssignmentFilter[] = "set_sources_assignment_filter";
480 const char kSetSourcesAssignmentFilter_HelpShort[] = 481 const char kSetSourcesAssignmentFilter_HelpShort[] =
481 "set_sources_assignment_filter: Set a pattern to filter source files."; 482 "set_sources_assignment_filter: Set a pattern to filter source files.";
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 return Value(); 782 return Value();
782 return result; 783 return result;
783 } 784 }
784 785
785 // Otherwise it's a no-block function. 786 // Otherwise it's a no-block function.
786 return found_function->second.no_block_runner(scope, function, 787 return found_function->second.no_block_runner(scope, function,
787 args.list_value(), err); 788 args.list_value(), err);
788 } 789 }
789 790
790 } // namespace functions 791 } // namespace functions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698