| OLD | NEW |
| 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/ninja_binary_target_writer.h" | 5 #include "tools/gn/ninja_binary_target_writer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <cstring> | 10 #include <cstring> |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 lib_escape_opts); | 847 lib_escape_opts); |
| 848 } else { | 848 } else { |
| 849 out_ << " " << tool_->lib_switch(); | 849 out_ << " " << tool_->lib_switch(); |
| 850 EscapeStringToStream(out_, lib_value, lib_escape_opts); | 850 EscapeStringToStream(out_, lib_value, lib_escape_opts); |
| 851 } | 851 } |
| 852 } | 852 } |
| 853 out_ << std::endl; | 853 out_ << std::endl; |
| 854 } | 854 } |
| 855 | 855 |
| 856 void NinjaBinaryTargetWriter::WriteOutputExtension() { | 856 void NinjaBinaryTargetWriter::WriteOutputExtension() { |
| 857 out_ << " output_extension = "; | 857 out_ << " output_extension = " |
| 858 if (target_->output_extension().empty()) { | 858 << SubstitutionWriter::GetLinkerSubstitution( |
| 859 // Use the default from the tool. | 859 target_, tool_, SUBSTITUTION_OUTPUT_EXTENSION); |
| 860 out_ << tool_->default_output_extension(); | |
| 861 } else { | |
| 862 // Use the one specified in the target. Note that the one in the target | |
| 863 // does not include the leading dot, so add that. | |
| 864 out_ << "." << target_->output_extension(); | |
| 865 } | |
| 866 out_ << std::endl; | 860 out_ << std::endl; |
| 867 } | 861 } |
| 868 | 862 |
| 869 void NinjaBinaryTargetWriter::WriteSolibs( | 863 void NinjaBinaryTargetWriter::WriteSolibs( |
| 870 const std::vector<OutputFile>& solibs) { | 864 const std::vector<OutputFile>& solibs) { |
| 871 if (solibs.empty()) | 865 if (solibs.empty()) |
| 872 return; | 866 return; |
| 873 | 867 |
| 874 out_ << " solibs ="; | 868 out_ << " solibs ="; |
| 875 path_output_.WriteFiles(out_, solibs); | 869 path_output_.WriteFiles(out_, solibs); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 "\n" | 998 "\n" |
| 1005 "In the latter case, either rename one of the files or move one of\n" | 999 "In the latter case, either rename one of the files or move one of\n" |
| 1006 "the sources to a separate source_set to avoid them both being in\n" | 1000 "the sources to a separate source_set to avoid them both being in\n" |
| 1007 "the same target."); | 1001 "the same target."); |
| 1008 g_scheduler->FailWithError(err); | 1002 g_scheduler->FailWithError(err); |
| 1009 return false; | 1003 return false; |
| 1010 } | 1004 } |
| 1011 } | 1005 } |
| 1012 return true; | 1006 return true; |
| 1013 } | 1007 } |
| OLD | NEW |