summaryrefslogtreecommitdiffstats
path: root/tools/gn/config_values.h
blob: 9a0aad25f914165f19d0cb783983b7a85f208b1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef TOOLS_GN_CONFIG_VALUES_H_
#define TOOLS_GN_CONFIG_VALUES_H_

#include <string>
#include <vector>

#include "base/basictypes.h"
#include "tools/gn/source_dir.h"

// Holds the values (includes, defines, compiler flags, etc.) for a given
// config or target.
class ConfigValues {
 public:
  ConfigValues();
  ~ConfigValues();

  const std::vector<SourceDir>& includes() const { return includes_; }
  void swap_in_includes(std::vector<SourceDir>* lo) { includes_.swap(*lo); }

#define VALUES_ACCESSOR(name) \
    const std::vector<std::string>& name() const { return name##_; } \
    void swap_in_##name(std::vector<std::string>* v) { name##_.swap(*v); }

  VALUES_ACCESSOR(defines)
  VALUES_ACCESSOR(cflags)
  VALUES_ACCESSOR(cflags_c)
  VALUES_ACCESSOR(cflags_cc)
  VALUES_ACCESSOR(cflags_objc)
  VALUES_ACCESSOR(cflags_objcc)
  VALUES_ACCESSOR(ldflags)

#undef VALUES_ACCESSOR

 private:
  std::vector<SourceDir> includes_;
  std::vector<std::string> defines_;
  std::vector<std::string> cflags_;
  std::vector<std::string> cflags_c_;
  std::vector<std::string> cflags_cc_;
  std::vector<std::string> cflags_objc_;
  std::vector<std::string> cflags_objcc_;
  std::vector<std::string> ldflags_;

  DISALLOW_COPY_AND_ASSIGN(ConfigValues);
};

#endif  // TOOLS_GN_CONFIG_VALUES_H_