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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 private: | 44 private: |
45 bool flags_[static_cast<int>(SOURCE_NUMTYPES)]; | 45 bool flags_[static_cast<int>(SOURCE_NUMTYPES)]; |
46 }; | 46 }; |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 // Returns the proper escape options for writing compiler and linker flags. | 50 // Returns the proper escape options for writing compiler and linker flags. |
51 EscapeOptions GetFlagOptions() { | 51 EscapeOptions GetFlagOptions() { |
52 EscapeOptions opts; | 52 EscapeOptions opts; |
53 opts.mode = ESCAPE_NINJA_COMMAND; | 53 opts.mode = ESCAPE_NINJA_COMMAND; |
54 | |
55 // Some flag strings are actually multiple flags that expect to be just | |
56 // added to the command line. We assume that quoting is done by the | |
57 // buildfiles if it wants such things quoted. | |
58 opts.inhibit_quoting = true; | |
59 | |
60 return opts; | 54 return opts; |
61 } | 55 } |
62 | 56 |
63 struct DefineWriter { | 57 struct DefineWriter { |
64 DefineWriter() { | 58 DefineWriter() { |
65 options.mode = ESCAPE_NINJA_COMMAND; | 59 options.mode = ESCAPE_NINJA_COMMAND; |
66 } | 60 } |
67 | 61 |
68 void operator()(const std::string& s, std::ostream& out) const { | 62 void operator()(const std::string& s, std::ostream& out) const { |
69 out << " -D"; | 63 out << " -D"; |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 "\n" | 992 "\n" |
999 "In the latter case, either rename one of the files or move one of\n" | 993 "In the latter case, either rename one of the files or move one of\n" |
1000 "the sources to a separate source_set to avoid them both being in\n" | 994 "the sources to a separate source_set to avoid them both being in\n" |
1001 "the same target."); | 995 "the same target."); |
1002 g_scheduler->FailWithError(err); | 996 g_scheduler->FailWithError(err); |
1003 return false; | 997 return false; |
1004 } | 998 } |
1005 } | 999 } |
1006 return true; | 1000 return true; |
1007 } | 1001 } |
OLD | NEW |