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

Side by Side Diff: trunk/src/tools/gn/ninja_target_writer.h

Issue 46313006: Revert 232657 "GN: toolchain threading cleanup" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
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_TARGET_WRITER_H_ 5 #ifndef TOOLS_GN_NINJA_TARGET_WRITER_H_
6 #define TOOLS_GN_NINJA_TARGET_WRITER_H_ 6 #define TOOLS_GN_NINJA_TARGET_WRITER_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "tools/gn/ninja_helper.h" 11 #include "tools/gn/ninja_helper.h"
12 #include "tools/gn/path_output.h" 12 #include "tools/gn/path_output.h"
13 13
14 class FileTemplate; 14 class FileTemplate;
15 class Settings; 15 class Settings;
16 class Target; 16 class Target;
17 17
18 // Generates one target's ".ninja" file. The toplevel "build.ninja" file is 18 // Generates one target's ".ninja" file. The toplevel "build.ninja" file is
19 // generated by the NinjaBuildWriter. 19 // generated by the NinjaBuildWriter.
20 class NinjaTargetWriter { 20 class NinjaTargetWriter {
21 public: 21 public:
22 NinjaTargetWriter(const Target* target, 22 NinjaTargetWriter(const Target* target, std::ostream& out);
23 const Toolchain* toolchain,
24 std::ostream& out);
25 virtual ~NinjaTargetWriter(); 23 virtual ~NinjaTargetWriter();
26 24
27 static void RunAndWriteFile(const Target* target); 25 static void RunAndWriteFile(const Target* target);
28 26
29 virtual void Run() = 0; 27 virtual void Run() = 0;
30 28
31 protected: 29 protected:
30 // Returns the toolchain associated with the target.
31 const Toolchain* GetToolchain() const;
32
32 // Returns the string to be appended to source rules that encodes the 33 // Returns the string to be appended to source rules that encodes the
33 // order-only dependencies for the current target. This will include the 34 // order-only dependencies for the current target. This will include the
34 // "|" character so can just be appended to the source rules. If there are no 35 // "|" character so can just be appended to the source rules. If there are no
35 // implicit dependencies, returns the empty string. 36 // implicit dependencies, returns the empty string.
36 std::string GetSourcesImplicitDeps() const; 37 std::string GetSourcesImplicitDeps() const;
37 38
38 // Returns the FileTemplate constructed from the outputs variable. 39 // Returns the FileTemplate constructed from the outputs variable.
39 FileTemplate GetOutputTemplate() const; 40 FileTemplate GetOutputTemplate() const;
40 41
41 const Settings* settings_; // Non-owning. 42 const Settings* settings_; // Non-owning.
42 const Target* target_; // Non-owning. 43 const Target* target_; // Non-owning.
43 const Toolchain* toolchain_; // Non-owning.
44 std::ostream& out_; 44 std::ostream& out_;
45 PathOutput path_output_; 45 PathOutput path_output_;
46 46
47 NinjaHelper helper_; 47 NinjaHelper helper_;
48 48
49 private: 49 private:
50 void WriteCopyRules(); 50 void WriteCopyRules();
51 51
52 DISALLOW_COPY_AND_ASSIGN(NinjaTargetWriter); 52 DISALLOW_COPY_AND_ASSIGN(NinjaTargetWriter);
53 }; 53 };
54 54
55 #endif // TOOLS_GN_NINJA_TARGET_WRITER_H_ 55 #endif // TOOLS_GN_NINJA_TARGET_WRITER_H_
OLDNEW
« no previous file with comments | « trunk/src/tools/gn/ninja_script_target_writer_unittest.cc ('k') | trunk/src/tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698