• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015 Google Inc. All rights reserved
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef FLAGS_H_
16 #define FLAGS_H_
17 
18 #include <string>
19 #include <vector>
20 
21 #include "string_piece.h"
22 #include "symtab.h"
23 
24 using namespace std;
25 
26 struct Flags {
27   bool detect_android_echo;
28   bool detect_depfiles;
29   bool dump_kati_stamp;
30   bool enable_debug;
31   bool enable_kati_warnings;
32   bool enable_stat_logs;
33   bool gen_all_targets;
34   bool generate_ninja;
35   bool generate_empty_ninja;
36   bool is_dry_run;
37   bool is_silent_mode;
38   bool is_syntax_check_only;
39   bool regen;
40   bool regen_debug;
41   bool regen_ignoring_kati_binary;
42   bool use_find_emulator;
43   bool color_warnings;
44   bool no_builtin_rules;
45   bool no_ninja_prelude;
46   bool werror_find_emulator;
47   bool werror_overriding_commands;
48   bool warn_implicit_rules;
49   bool werror_implicit_rules;
50   bool warn_suffix_rules;
51   bool werror_suffix_rules;
52   bool top_level_phony;
53   bool warn_real_to_phony;
54   bool werror_real_to_phony;
55   bool warn_phony_looks_real;
56   bool werror_phony_looks_real;
57   bool werror_writable;
58   const char* goma_dir;
59   const char* ignore_dirty_pattern;
60   const char* no_ignore_dirty_pattern;
61   const char* ignore_optional_include_pattern;
62   const char* makefile;
63   const char* ninja_dir;
64   const char* ninja_suffix;
65   int num_cpus;
66   int num_jobs;
67   int remote_num_jobs;
68   vector<const char*> subkati_args;
69   vector<Symbol> targets;
70   vector<StringPiece> cl_vars;
71   vector<string> writable;
72 
73   void Parse(int argc, char** argv);
74 };
75 
76 extern Flags g_flags;
77 
78 #endif  // FLAGS_H_
79