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

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

Issue 1690843002: gn: Add runtime_link_output to tool("solib") (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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/target.h" 5 #include "tools/gn/target.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 // first output. 506 // first output.
507 CHECK(tool->outputs().list().size() >= 1); 507 CHECK(tool->outputs().list().size() >= 1);
508 check_tool_outputs = true; 508 check_tool_outputs = true;
509 link_output_file_ = dependency_output_file_ = 509 link_output_file_ = dependency_output_file_ =
510 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile( 510 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile(
511 this, tool, tool->outputs().list()[0]); 511 this, tool, tool->outputs().list()[0]);
512 break; 512 break;
513 case SHARED_LIBRARY: 513 case SHARED_LIBRARY:
514 CHECK(tool->outputs().list().size() >= 1); 514 CHECK(tool->outputs().list().size() >= 1);
515 check_tool_outputs = true; 515 check_tool_outputs = true;
516 // XXX
516 if (tool->link_output().empty() && tool->depend_output().empty()) { 517 if (tool->link_output().empty() && tool->depend_output().empty()) {
517 // Default behavior, use the first output file for both. 518 // Default behavior, use the first output file for both.
518 link_output_file_ = dependency_output_file_ = 519 link_output_file_ = dependency_output_file_ =
519 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile( 520 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile(
520 this, tool, tool->outputs().list()[0]); 521 this, tool, tool->outputs().list()[0]);
521 } else { 522 } else {
522 // Use the tool-specified ones. 523 // Use the tool-specified ones.
523 if (!tool->link_output().empty()) { 524 if (!tool->link_output().empty()) {
524 link_output_file_ = 525 link_output_file_ =
525 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile( 526 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile(
526 this, tool, tool->link_output()); 527 this, tool, tool->link_output());
527 } 528 }
528 if (!tool->depend_output().empty()) { 529 if (!tool->depend_output().empty()) {
529 dependency_output_file_ = 530 dependency_output_file_ =
530 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile( 531 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile(
531 this, tool, tool->depend_output()); 532 this, tool, tool->depend_output());
532 } 533 }
533 } 534 }
535 if (tool->runtime_link_output().empty()) {
536 runtime_link_output_file_ = link_output_file_;
537 } else {
538 runtime_link_output_file_ =
539 SubstitutionWriter::ApplyPatternToLinkerAsOutputFile(
540 this, tool, tool->runtime_link_output());
541 }
534 break; 542 break;
535 case UNKNOWN: 543 case UNKNOWN:
536 default: 544 default:
537 NOTREACHED(); 545 NOTREACHED();
538 } 546 }
539 547
540 // Count all outputs from this tool as something generated by this target. 548 // Count all outputs from this tool as something generated by this target.
541 if (check_tool_outputs) { 549 if (check_tool_outputs) {
542 SubstitutionWriter::ApplyListToLinkerAsOutputFile( 550 SubstitutionWriter::ApplyListToLinkerAsOutputFile(
543 this, tool, tool->outputs(), &computed_outputs_); 551 this, tool, tool->outputs(), &computed_outputs_);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, false, 718 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, false,
711 &seen_targets)) { 719 &seen_targets)) {
712 // Check object files (much slower and very rare) only if the "normal" 720 // Check object files (much slower and very rare) only if the "normal"
713 // output check failed. 721 // output check failed.
714 seen_targets.clear(); 722 seen_targets.clear();
715 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, true, 723 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, true,
716 &seen_targets)) 724 &seen_targets))
717 g_scheduler->AddUnknownGeneratedInput(this, source); 725 g_scheduler->AddUnknownGeneratedInput(this, source);
718 } 726 }
719 } 727 }
OLDNEW
« tools/gn/runtime_deps.cc ('K') | « tools/gn/target.h ('k') | tools/gn/tool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698