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_GENERATOR_H_ 6 #define TOOLS_GN_CONFIG_VALUES_GENERATOR_H_ 7 8 #include "base/macros.h" 9 #include "gn/source_dir.h" 10 11 class ConfigValues; 12 class Err; 13 class Scope; 14 15 // This class fills in the config values from a given scope. It's shared 16 // between the "config" function call and all the different binary target types 17 // (shared library, static library, etc.) since all of these support the 18 // various flags stored in the ConfigValues class. 19 class ConfigValuesGenerator { 20 public: 21 ConfigValuesGenerator(ConfigValues* dest_values, 22 Scope* scope, 23 const SourceDir& input_dir, 24 Err* err); 25 ~ConfigValuesGenerator(); 26 27 // Sets the error passed to the constructor on failure. 28 void Run(); 29 30 private: 31 ConfigValues* config_values_; 32 Scope* scope_; 33 const SourceDir input_dir_; 34 Err* err_; 35 36 DISALLOW_COPY_AND_ASSIGN(ConfigValuesGenerator); 37 }; 38 39 // For using in documentation for functions which use this. 40 #define CONFIG_VALUES_VARS_HELP \ 41 " Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc,\n" \ 42 " asmflags, defines, include_dirs, inputs, ldflags, lib_dirs,\n" \ 43 " libs, precompiled_header, precompiled_source, rustflags,\n" \ 44 " rustenv\n" 45 46 #endif // TOOLS_GN_CONFIG_VALUES_GENERATOR_H_ 47