Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: tools/gn/ninja_binary_target_writer.h

Issue 1292983004: [GN]: Precompiled header support for GCC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Brett’s comments... (hopefully) Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_ 5 #ifndef TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_
6 #define TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_ 6 #define TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "tools/gn/config_values.h" 9 #include "tools/gn/config_values.h"
10 #include "tools/gn/ninja_target_writer.h" 10 #include "tools/gn/ninja_target_writer.h"
(...skipping 29 matching lines...) Expand all
40 // tool-specific (e.g. "cflags_c"). For non-tool-specific flags (e.g. 40 // tool-specific (e.g. "cflags_c"). For non-tool-specific flags (e.g.
41 // "defines") tool_type should be TYPE_NONE. 41 // "defines") tool_type should be TYPE_NONE.
42 void WriteOneFlag( 42 void WriteOneFlag(
43 SubstitutionType subst_enum, 43 SubstitutionType subst_enum,
44 bool has_precompiled_headers, 44 bool has_precompiled_headers,
45 Toolchain::ToolType tool_type, 45 Toolchain::ToolType tool_type,
46 const std::vector<std::string>& (ConfigValues::* getter)() const, 46 const std::vector<std::string>& (ConfigValues::* getter)() const,
47 EscapeOptions flag_escape_options); 47 EscapeOptions flag_escape_options);
48 48
49 // Writes build lines required for precompiled headers. Any generated 49 // Writes build lines required for precompiled headers. Any generated
50 // object files will be appended to the given vector. 50 // object files will be appended to the |object_files|. Any generated
51 // non-object files (for instance, .gch files from a GCC toolchain, are
52 // appended to |other_files|).
51 // 53 //
52 // input_dep is the stamp file collecting the dependencies required before 54 // input_dep is the stamp file collecting the dependencies required before
53 // compiling this target. It will be empty if there are no input deps. 55 // compiling this target. It will be empty if there are no input deps.
54 void WritePrecompiledHeaderCommands(const SourceFileTypeSet& used_types, 56 // Returns false on failure.
55 const OutputFile& input_dep, 57 bool WritePCHCommands(const SourceFileTypeSet& used_types,
56 std::vector<OutputFile>* object_files); 58 const OutputFile& input_dep,
59 std::vector<OutputFile>* object_files,
60 std::vector<OutputFile>* other_files);
57 61
58 // Writes a Windows .pch compile build line for a language type. 62 // Writes a .pch compile build line for a language type. Returns false on
59 void WriteWindowsPCHCommand(SubstitutionType flag_type, 63 // failure.
64 bool WritePCHCommand(SubstitutionType flag_type,
65 Toolchain::ToolType tool_type,
66 Tool::PrecompiledHeaderType header_type,
67 const OutputFile& input_dep,
68 std::vector<OutputFile>* object_files,
69 std::vector<OutputFile>* other_files);
70
71 bool WriteGCCPCHCommand(SubstitutionType flag_type,
72 Toolchain::ToolType tool_type,
73 const OutputFile& order_only_dep,
74 std::vector<OutputFile>* gch_files);
75
76 bool WriteWindowsPCHCommand(SubstitutionType flag_type,
60 Toolchain::ToolType tool_type, 77 Toolchain::ToolType tool_type,
61 const OutputFile& input_dep, 78 const OutputFile& order_only_dep,
62 std::vector<OutputFile>* object_files); 79 std::vector<OutputFile>* object_files);
63 80
64 // extra_deps are additional dependencies to run before the rule. 81 // pch_deps are additional dependencies to run before the rule. They are
82 // expected to abide by the naming conventions specified by GetPCHOutputFiles.
65 // 83 //
66 // iorder_only_dep is the name of the stamp file that covers the dependencies 84 // order_only_dep is the name of the stamp file that covers the dependencies
67 // that must be run before doing any compiles. 85 // that must be run before doing any compiles.
68 // 86 //
69 // The files produced by the compiler will be added to two output vectors. 87 // The files produced by the compiler will be added to two output vectors.
70 void WriteSources(const std::vector<OutputFile>& extra_deps, 88 void WriteSources(const std::vector<OutputFile>& pch_deps,
71 const OutputFile& order_only_dep, 89 const OutputFile& order_only_dep,
72 std::vector<OutputFile>* object_files, 90 std::vector<OutputFile>* object_files,
73 std::vector<SourceFile>* other_files); 91 std::vector<SourceFile>* other_files);
74 92
75 // Writes a build line. 93 // Writes a build line.
76 void WriteCompilerBuildLine(const SourceFile& source, 94 void WriteCompilerBuildLine(const SourceFile& source,
77 const std::vector<OutputFile>& extra_deps, 95 const std::vector<OutputFile>& extra_deps,
78 const OutputFile& order_only_dep, 96 const OutputFile& order_only_dep,
79 Toolchain::ToolType tool_type, 97 Toolchain::ToolType tool_type,
80 const std::vector<OutputFile>& outputs); 98 const std::vector<OutputFile>& outputs);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const Tool* tool_; 141 const Tool* tool_;
124 142
125 // Cached version of the prefix used for rule types for this toolchain. 143 // Cached version of the prefix used for rule types for this toolchain.
126 std::string rule_prefix_; 144 std::string rule_prefix_;
127 145
128 DISALLOW_COPY_AND_ASSIGN(NinjaBinaryTargetWriter); 146 DISALLOW_COPY_AND_ASSIGN(NinjaBinaryTargetWriter);
129 }; 147 };
130 148
131 #endif // TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_ 149 #endif // TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_
132 150
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698