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); |
} |