| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 std::vector<OutputFile> outputs; | 473 std::vector<OutputFile> outputs; |
| 474 GetPCHOutputFiles(target_, tool_type, &outputs); | 474 GetPCHOutputFiles(target_, tool_type, &outputs); |
| 475 if (!outputs.empty()) { | 475 if (!outputs.empty()) { |
| 476 // Trim the .gch suffix for the -include flag. | 476 // Trim the .gch suffix for the -include flag. |
| 477 // e.g. for gch file foo/bar/target.precompiled.h.gch: | 477 // e.g. for gch file foo/bar/target.precompiled.h.gch: |
| 478 // -include foo/bar/target.precompiled.h | 478 // -include foo/bar/target.precompiled.h |
| 479 std::string pch_file = outputs[0].value(); | 479 std::string pch_file = outputs[0].value(); |
| 480 pch_file.erase(pch_file.length() - 4); | 480 pch_file.erase(pch_file.length() - 4); |
| 481 out_ << " -include " << pch_file; | 481 out_ << " -include " << pch_file; |
| 482 } | 482 } |
| 483 } else { |
| 484 RecursiveTargetConfigStringsToStream(target_, getter, |
| 485 flag_escape_options, out_); |
| 483 } | 486 } |
| 484 } else { | 487 } else { |
| 485 RecursiveTargetConfigStringsToStream(target_, getter, | 488 RecursiveTargetConfigStringsToStream(target_, getter, |
| 486 flag_escape_options, out_); | 489 flag_escape_options, out_); |
| 487 } | 490 } |
| 488 out_ << std::endl; | 491 out_ << std::endl; |
| 489 } | 492 } |
| 490 | 493 |
| 491 void NinjaBinaryTargetWriter::WritePCHCommands( | 494 void NinjaBinaryTargetWriter::WritePCHCommands( |
| 492 const SourceFileTypeSet& used_types, | 495 const SourceFileTypeSet& used_types, |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 "\n" | 1068 "\n" |
| 1066 "In the latter case, either rename one of the files or move one of\n" | 1069 "In the latter case, either rename one of the files or move one of\n" |
| 1067 "the sources to a separate source_set to avoid them both being in\n" | 1070 "the sources to a separate source_set to avoid them both being in\n" |
| 1068 "the same target."); | 1071 "the same target."); |
| 1069 g_scheduler->FailWithError(err); | 1072 g_scheduler->FailWithError(err); |
| 1070 return false; | 1073 return false; |
| 1071 } | 1074 } |
| 1072 } | 1075 } |
| 1073 return true; | 1076 return true; |
| 1074 } | 1077 } |
| OLD | NEW |