Chromium Code Reviews| 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 #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" |
| 11 #include "tools/gn/toolchain.h" | 11 #include "tools/gn/toolchain.h" |
| 12 #include "tools/gn/unique_vector.h" | 12 #include "tools/gn/unique_vector.h" |
| 13 | 13 |
| 14 struct EscapeOptions; | 14 struct EscapeOptions; |
| 15 | 15 |
| 16 // Writes a .ninja file for a binary target type (an executable, a shared | 16 // Writes a .ninja file for a binary target type (an executable, a shared |
| 17 // library, or a static library). | 17 // library, or a static library). |
| 18 class NinjaBinaryTargetWriter : public NinjaTargetWriter { | 18 class NinjaBinaryTargetWriter : public NinjaTargetWriter { |
| 19 public: | 19 public: |
| 20 NinjaBinaryTargetWriter(const Target* target, std::ostream& out); | 20 NinjaBinaryTargetWriter(const Target* target, std::ostream& out); |
| 21 ~NinjaBinaryTargetWriter() override; | 21 ~NinjaBinaryTargetWriter() override; |
| 22 | 22 |
| 23 void Run() override; | 23 void Run() override; |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 typedef std::set<OutputFile> OutputFileSet; | 26 typedef std::set<OutputFile> OutputFileSet; |
| 27 | 27 |
| 28 void WriteCompilerVars(); | 28 void WriteCompilerVars(); |
| 29 void WriteSources(std::vector<OutputFile>* object_files); | 29 void WriteSources(std::vector<OutputFile>* object_files, |
| 30 void WriteLinkerStuff(const std::vector<OutputFile>& object_files); | 30 std::vector<SourceFile>* other_files); |
| 31 void WriteLinkerFlags(); | 31 void WriteLinkerStuff(const std::vector<OutputFile>& object_files, |
| 32 const std::vector<SourceFile>& other_files); | |
| 33 void WriteLinkerFlags(const SourceFile* def_file); | |
|
brettw
2015/05/27 17:27:00
Maybe call this variable optional_def_file so it's
| |
| 32 void WriteLibs(); | 34 void WriteLibs(); |
| 33 void WriteOutputExtension(); | 35 void WriteOutputExtension(); |
| 34 void WriteSolibs(const std::vector<OutputFile>& solibs); | 36 void WriteSolibs(const std::vector<OutputFile>& solibs); |
| 35 | 37 |
| 36 // Writes the stamp line for a source set. These are not linked. | 38 // Writes the stamp line for a source set. These are not linked. |
| 37 void WriteSourceSetStamp(const std::vector<OutputFile>& object_files); | 39 void WriteSourceSetStamp(const std::vector<OutputFile>& object_files); |
| 38 | 40 |
| 39 // Gets all target dependencies and classifies them, as well as accumulates | 41 // Gets all target dependencies and classifies them, as well as accumulates |
| 40 // object files from source sets we need to link. | 42 // object files from source sets we need to link. |
| 41 void GetDeps(UniqueVector<OutputFile>* extra_object_files, | 43 void GetDeps(UniqueVector<OutputFile>* extra_object_files, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 Toolchain::ToolType* computed_tool_type, | 78 Toolchain::ToolType* computed_tool_type, |
| 77 std::vector<OutputFile>* outputs) const; | 79 std::vector<OutputFile>* outputs) const; |
| 78 | 80 |
| 79 const Tool* tool_; | 81 const Tool* tool_; |
| 80 | 82 |
| 81 DISALLOW_COPY_AND_ASSIGN(NinjaBinaryTargetWriter); | 83 DISALLOW_COPY_AND_ASSIGN(NinjaBinaryTargetWriter); |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 #endif // TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_ | 86 #endif // TOOLS_GN_NINJA_BINARY_TARGET_WRITER_H_ |
| 85 | 87 |
| OLD | NEW |