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 <cstring> | 7 #include <cstring> |
8 #include <set> | 8 #include <set> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 GetPCHOutputFiles(target_, tool_type, &outputs); | 485 GetPCHOutputFiles(target_, tool_type, &outputs); |
486 if (!outputs.empty()) { | 486 if (!outputs.empty()) { |
487 // Trim the .gch suffix for the -include flag. | 487 // Trim the .gch suffix for the -include flag. |
488 // e.g. for gch file foo/bar/target.precompiled.h.gch: | 488 // e.g. for gch file foo/bar/target.precompiled.h.gch: |
489 // -include foo/bar/target.precompiled.h | 489 // -include foo/bar/target.precompiled.h |
490 std::string pch_file = outputs[0].value(); | 490 std::string pch_file = outputs[0].value(); |
491 pch_file.erase(pch_file.length() - 4); | 491 pch_file.erase(pch_file.length() - 4); |
492 out_ << " -include " << pch_file; | 492 out_ << " -include " << pch_file; |
493 } | 493 } |
494 } | 494 } |
| 495 } else { |
| 496 RecursiveTargetConfigStringsToStream(target_, getter, |
| 497 flag_escape_options, out_); |
495 } | 498 } |
496 out_ << std::endl; | 499 out_ << std::endl; |
497 } | 500 } |
498 | 501 |
499 void NinjaBinaryTargetWriter::WritePCHCommands( | 502 void NinjaBinaryTargetWriter::WritePCHCommands( |
500 const SourceFileTypeSet& used_types, | 503 const SourceFileTypeSet& used_types, |
501 const OutputFile& order_only_dep, | 504 const OutputFile& order_only_dep, |
502 std::vector<OutputFile>* object_files, | 505 std::vector<OutputFile>* object_files, |
503 std::vector<OutputFile>* other_files) { | 506 std::vector<OutputFile>* other_files) { |
504 if (!target_->config_values().has_precompiled_headers()) | 507 if (!target_->config_values().has_precompiled_headers()) |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 "\n" | 1029 "\n" |
1027 "In the latter case, either rename one of the files or move one of\n" | 1030 "In the latter case, either rename one of the files or move one of\n" |
1028 "the sources to a separate source_set to avoid them both being in\n" | 1031 "the sources to a separate source_set to avoid them both being in\n" |
1029 "the same target."); | 1032 "the same target."); |
1030 g_scheduler->FailWithError(err); | 1033 g_scheduler->FailWithError(err); |
1031 return false; | 1034 return false; |
1032 } | 1035 } |
1033 } | 1036 } |
1034 return true; | 1037 return true; |
1035 } | 1038 } |
OLD | NEW |