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

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

Issue 2394163004: GN: Check if targets with precompiled headers use unsupported toolchains. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 2 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
« no previous file with comments | « tools/gn/ninja_binary_target_writer.cc ('k') | tools/gn/target.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SOURCE_FILE_TYPE_H_ 5 #ifndef TOOLS_GN_SOURCE_FILE_TYPE_H_
6 #define TOOLS_GN_SOURCE_FILE_TYPE_H_ 6 #define TOOLS_GN_SOURCE_FILE_TYPE_H_
7 7
8 class SourceFile; 8 class SourceFile;
9 9
10 // This should be sequential integers starting from 0 so they can be used as 10 // This should be sequential integers starting from 0 so they can be used as
(...skipping 10 matching lines...) Expand all
21 SOURCE_RC, 21 SOURCE_RC,
22 SOURCE_O, // Object files can be inputs, too. Also counts .obj. 22 SOURCE_O, // Object files can be inputs, too. Also counts .obj.
23 SOURCE_DEF, 23 SOURCE_DEF,
24 24
25 // Must be last. 25 // Must be last.
26 SOURCE_NUMTYPES, 26 SOURCE_NUMTYPES,
27 }; 27 };
28 28
29 SourceFileType GetSourceFileType(const SourceFile& file); 29 SourceFileType GetSourceFileType(const SourceFile& file);
30 30
31 // Represents a set of tool types.
32 class SourceFileTypeSet {
33 public:
34 SourceFileTypeSet() {
35 for (auto& flag : flags_)
36 flag = 0;
37 }
38
39 void Set(SourceFileType type) { flags_[static_cast<int>(type)] = true; }
40 bool Get(SourceFileType type) const { return flags_[static_cast<int>(type)]; }
41
42 private:
43 bool flags_[static_cast<int>(SOURCE_NUMTYPES)];
44 };
45
31 #endif // TOOLS_GN_SOURCE_FILE_TYPE_H_ 46 #endif // TOOLS_GN_SOURCE_FILE_TYPE_H_
OLDNEW
« no previous file with comments | « tools/gn/ninja_binary_target_writer.cc ('k') | tools/gn/target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698