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

Unified Diff: tools/gn/ninja_binary_target_writer.cc

Issue 1660213002: GN: Don't write ldflags and libs when unneeded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update reference Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/ninja_binary_target_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_binary_target_writer.cc
diff --git a/tools/gn/ninja_binary_target_writer.cc b/tools/gn/ninja_binary_target_writer.cc
index fa8849aa26dfeb06abedfa0591ca4d942afff91b..b1bf8032e1bccd902164d59eb6f6aab802e00f6a 100644
--- a/tools/gn/ninja_binary_target_writer.cc
+++ b/tools/gn/ninja_binary_target_writer.cc
@@ -779,10 +779,13 @@ void NinjaBinaryTargetWriter::WriteLinkerStuff(
// End of the link "build" line.
out_ << std::endl;
- // These go in the inner scope of the link line.
- WriteLinkerFlags(optional_def_file);
-
- WriteLibs();
+ // The remaining things go in the inner scope of the link line.
+ if (target_->output_type() == Target::EXECUTABLE ||
+ target_->output_type() == Target::SHARED_LIBRARY ||
+ target_->output_type() == Target::LOADABLE_MODULE) {
+ WriteLinkerFlags(optional_def_file);
+ WriteLibs();
+ }
WriteOutputExtension();
WriteSolibs(solibs);
}
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/ninja_binary_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698