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 3// found in the LICENSE file. 4 5#ifndef TOOLS_GN_CONFIG_VALUES_H_ 6#define TOOLS_GN_CONFIG_VALUES_H_ 7 8#include <string> 9#include <vector> 10 11#include "base/basictypes.h" 12#include "tools/gn/source_dir.h" 13 14// Holds the values (includes, defines, compiler flags, etc.) for a given 15// config or target. 16class ConfigValues { 17 public: 18 ConfigValues(); 19 ~ConfigValues(); 20 21 const std::vector<SourceDir>& includes() const { return includes_; } 22 void swap_in_includes(std::vector<SourceDir>* lo) { includes_.swap(*lo); } 23 24#define VALUES_ACCESSOR(name) \ 25 const std::vector<std::string>& name() const { return name##_; } \ 26 void swap_in_##name(std::vector<std::string>* v) { name##_.swap(*v); } 27 28 VALUES_ACCESSOR(defines) 29 VALUES_ACCESSOR(cflags) 30 VALUES_ACCESSOR(cflags_c) 31 VALUES_ACCESSOR(cflags_cc) 32 VALUES_ACCESSOR(cflags_objc) 33 VALUES_ACCESSOR(cflags_objcc) 34 VALUES_ACCESSOR(ldflags) 35 36#undef VALUES_ACCESSOR 37 38 private: 39 std::vector<SourceDir> includes_; 40 std::vector<std::string> defines_; 41 std::vector<std::string> cflags_; 42 std::vector<std::string> cflags_c_; 43 std::vector<std::string> cflags_cc_; 44 std::vector<std::string> cflags_objc_; 45 std::vector<std::string> cflags_objcc_; 46 std::vector<std::string> ldflags_; 47 48 DISALLOW_COPY_AND_ASSIGN(ConfigValues); 49}; 50 51#endif // TOOLS_GN_CONFIG_VALUES_H_ 52