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_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/lib_file.h" |
12 #include "tools/gn/source_dir.h" | 13 #include "tools/gn/source_dir.h" |
13 #include "tools/gn/source_file.h" | 14 #include "tools/gn/source_file.h" |
14 | 15 |
15 // Holds the values (include_dirs, defines, compiler flags, etc.) for a given | 16 // Holds the values (include_dirs, defines, compiler flags, etc.) for a given |
16 // config or target. | 17 // config or target. |
17 class ConfigValues { | 18 class ConfigValues { |
18 public: | 19 public: |
19 ConfigValues(); | 20 ConfigValues(); |
20 ~ConfigValues(); | 21 ~ConfigValues(); |
21 | 22 |
(...skipping 10 matching lines...) Expand all Loading... |
32 STRING_VALUES_ACCESSOR(asmflags) | 33 STRING_VALUES_ACCESSOR(asmflags) |
33 STRING_VALUES_ACCESSOR(cflags) | 34 STRING_VALUES_ACCESSOR(cflags) |
34 STRING_VALUES_ACCESSOR(cflags_c) | 35 STRING_VALUES_ACCESSOR(cflags_c) |
35 STRING_VALUES_ACCESSOR(cflags_cc) | 36 STRING_VALUES_ACCESSOR(cflags_cc) |
36 STRING_VALUES_ACCESSOR(cflags_objc) | 37 STRING_VALUES_ACCESSOR(cflags_objc) |
37 STRING_VALUES_ACCESSOR(cflags_objcc) | 38 STRING_VALUES_ACCESSOR(cflags_objcc) |
38 STRING_VALUES_ACCESSOR(defines) | 39 STRING_VALUES_ACCESSOR(defines) |
39 DIR_VALUES_ACCESSOR (include_dirs) | 40 DIR_VALUES_ACCESSOR (include_dirs) |
40 STRING_VALUES_ACCESSOR(ldflags) | 41 STRING_VALUES_ACCESSOR(ldflags) |
41 DIR_VALUES_ACCESSOR (lib_dirs) | 42 DIR_VALUES_ACCESSOR (lib_dirs) |
42 STRING_VALUES_ACCESSOR(libs) | |
43 // If you add a new one, be sure to update AppendValues(). | 43 // If you add a new one, be sure to update AppendValues(). |
44 | 44 |
45 #undef STRING_VALUES_ACCESSOR | 45 #undef STRING_VALUES_ACCESSOR |
46 #undef DIR_VALUES_ACCESSOR | 46 #undef DIR_VALUES_ACCESSOR |
47 | 47 |
| 48 const std::vector<LibFile>& libs() const { return libs_; } |
| 49 std::vector<LibFile>& libs() { return libs_; } |
| 50 |
48 bool has_precompiled_headers() const { | 51 bool has_precompiled_headers() const { |
49 return !precompiled_header_.empty() || !precompiled_source_.is_null(); | 52 return !precompiled_header_.empty() || !precompiled_source_.is_null(); |
50 } | 53 } |
51 const std::string& precompiled_header() const { | 54 const std::string& precompiled_header() const { |
52 return precompiled_header_; | 55 return precompiled_header_; |
53 } | 56 } |
54 void set_precompiled_header(const std::string& f) { | 57 void set_precompiled_header(const std::string& f) { |
55 precompiled_header_ = f; | 58 precompiled_header_ = f; |
56 } | 59 } |
57 const SourceFile& precompiled_source() const { | 60 const SourceFile& precompiled_source() const { |
58 return precompiled_source_; | 61 return precompiled_source_; |
59 } | 62 } |
60 void set_precompiled_source(const SourceFile& f) { | 63 void set_precompiled_source(const SourceFile& f) { |
61 precompiled_source_ = f; | 64 precompiled_source_ = f; |
62 } | 65 } |
63 | 66 |
64 private: | 67 private: |
65 std::vector<std::string> asmflags_; | 68 std::vector<std::string> asmflags_; |
66 std::vector<std::string> cflags_; | 69 std::vector<std::string> cflags_; |
67 std::vector<std::string> cflags_c_; | 70 std::vector<std::string> cflags_c_; |
68 std::vector<std::string> cflags_cc_; | 71 std::vector<std::string> cflags_cc_; |
69 std::vector<std::string> cflags_objc_; | 72 std::vector<std::string> cflags_objc_; |
70 std::vector<std::string> cflags_objcc_; | 73 std::vector<std::string> cflags_objcc_; |
71 std::vector<std::string> defines_; | 74 std::vector<std::string> defines_; |
72 std::vector<SourceDir> include_dirs_; | 75 std::vector<SourceDir> include_dirs_; |
73 std::vector<std::string> ldflags_; | 76 std::vector<std::string> ldflags_; |
74 std::vector<SourceDir> lib_dirs_; | 77 std::vector<SourceDir> lib_dirs_; |
75 std::vector<std::string> libs_; | 78 std::vector<LibFile> libs_; |
76 // If you add a new one, be sure to update AppendValues(). | 79 // If you add a new one, be sure to update AppendValues(). |
77 | 80 |
78 std::string precompiled_header_; | 81 std::string precompiled_header_; |
79 SourceFile precompiled_source_; | 82 SourceFile precompiled_source_; |
80 }; | 83 }; |
81 | 84 |
82 #endif // TOOLS_GN_CONFIG_VALUES_H_ | 85 #endif // TOOLS_GN_CONFIG_VALUES_H_ |
OLD | NEW |