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

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

Issue 1326053003: port cfi to gn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable CFI when targeting nacl 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_CONFIG_VALUES_H_ 5 #ifndef TOOLS_GN_CONFIG_VALUES_H_
6 #define TOOLS_GN_CONFIG_VALUES_H_ 6 #define TOOLS_GN_CONFIG_VALUES_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "tools/gn/source_dir.h" 12 #include "tools/gn/source_dir.h"
13 #include "tools/gn/source_file.h" 13 #include "tools/gn/source_file.h"
14 14
15 // Holds the values (include_dirs, defines, compiler flags, etc.) for a given 15 // Holds the values (include_dirs, defines, compiler flags, etc.) for a given
16 // config or target. 16 // config or target.
17 class ConfigValues { 17 class ConfigValues {
18 public: 18 public:
19 ConfigValues(); 19 ConfigValues();
20 ~ConfigValues(); 20 ~ConfigValues();
21 21
22 #define STRING_VALUES_ACCESSOR(name) \ 22 #define STRING_VALUES_ACCESSOR(name) \
23 const std::vector<std::string>& name() const { return name##_; } \ 23 const std::vector<std::string>& name() const { return name##_; } \
24 std::vector<std::string>& name() { return name##_; } 24 std::vector<std::string>& name() { return name##_; }
25 #define DIR_VALUES_ACCESSOR(name) \ 25 #define DIR_VALUES_ACCESSOR(name) \
26 const std::vector<SourceDir>& name() const { return name##_; } \ 26 const std::vector<SourceDir>& name() const { return name##_; } \
27 std::vector<SourceDir>& name() { return name##_; } 27 std::vector<SourceDir>& name() { return name##_; }
28 28
29 STRING_VALUES_ACCESSOR(arflags)
29 STRING_VALUES_ACCESSOR(cflags) 30 STRING_VALUES_ACCESSOR(cflags)
30 STRING_VALUES_ACCESSOR(cflags_c) 31 STRING_VALUES_ACCESSOR(cflags_c)
31 STRING_VALUES_ACCESSOR(cflags_cc) 32 STRING_VALUES_ACCESSOR(cflags_cc)
32 STRING_VALUES_ACCESSOR(cflags_objc) 33 STRING_VALUES_ACCESSOR(cflags_objc)
33 STRING_VALUES_ACCESSOR(cflags_objcc) 34 STRING_VALUES_ACCESSOR(cflags_objcc)
34 STRING_VALUES_ACCESSOR(defines) 35 STRING_VALUES_ACCESSOR(defines)
35 DIR_VALUES_ACCESSOR (include_dirs) 36 DIR_VALUES_ACCESSOR (include_dirs)
36 STRING_VALUES_ACCESSOR(ldflags) 37 STRING_VALUES_ACCESSOR(ldflags)
37 DIR_VALUES_ACCESSOR (lib_dirs) 38 DIR_VALUES_ACCESSOR (lib_dirs)
38 STRING_VALUES_ACCESSOR(libs) 39 STRING_VALUES_ACCESSOR(libs)
(...skipping 11 matching lines...) Expand all
50 precompiled_header_ = f; 51 precompiled_header_ = f;
51 } 52 }
52 const SourceFile& precompiled_source() const { 53 const SourceFile& precompiled_source() const {
53 return precompiled_source_; 54 return precompiled_source_;
54 } 55 }
55 void set_precompiled_source(const SourceFile& f) { 56 void set_precompiled_source(const SourceFile& f) {
56 precompiled_source_ = f; 57 precompiled_source_ = f;
57 } 58 }
58 59
59 private: 60 private:
61 std::vector<std::string> arflags_;
60 std::vector<std::string> cflags_; 62 std::vector<std::string> cflags_;
61 std::vector<std::string> cflags_c_; 63 std::vector<std::string> cflags_c_;
62 std::vector<std::string> cflags_cc_; 64 std::vector<std::string> cflags_cc_;
63 std::vector<std::string> cflags_objc_; 65 std::vector<std::string> cflags_objc_;
64 std::vector<std::string> cflags_objcc_; 66 std::vector<std::string> cflags_objcc_;
65 std::vector<std::string> defines_; 67 std::vector<std::string> defines_;
66 std::vector<SourceDir> include_dirs_; 68 std::vector<SourceDir> include_dirs_;
67 std::vector<std::string> ldflags_; 69 std::vector<std::string> ldflags_;
68 std::vector<SourceDir> lib_dirs_; 70 std::vector<SourceDir> lib_dirs_;
69 std::vector<std::string> libs_; 71 std::vector<std::string> libs_;
70 72
71 std::string precompiled_header_; 73 std::string precompiled_header_;
72 SourceFile precompiled_source_; 74 SourceFile precompiled_source_;
73 75
74 DISALLOW_COPY_AND_ASSIGN(ConfigValues); 76 DISALLOW_COPY_AND_ASSIGN(ConfigValues);
75 }; 77 };
76 78
77 #endif // TOOLS_GN_CONFIG_VALUES_H_ 79 #endif // TOOLS_GN_CONFIG_VALUES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698