blob: df26f5c95eef28fe439503934f234d6112706e55 [file] [log] [blame]
Shinichiro Hamaji08808d32015-06-26 08:02:45 +09001// 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
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090018#include <string>
19#include <vector>
20
21#include "string_piece.h"
22#include "symtab.h"
23
24using namespace std;
25
26struct Flags {
27 bool detect_android_echo;
Shinichiro Hamajif3ad9e02016-03-03 18:26:17 +090028 bool detect_depfiles;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090029 bool dump_kati_stamp;
Shinichiro Hamajic58db9a2016-05-12 15:16:12 +090030 bool enable_debug;
Shinichiro Hamaji644d6b92015-11-17 14:47:56 +090031 bool enable_kati_warnings;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090032 bool enable_stat_logs;
Shinichiro Hamaji7223e7b2015-09-28 15:17:27 +090033 bool gen_all_targets;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090034 bool generate_ninja;
Dan Willemsen87b8da72018-10-26 09:21:23 -070035 bool generate_empty_ninja;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090036 bool is_dry_run;
37 bool is_silent_mode;
38 bool is_syntax_check_only;
39 bool regen;
Dan Willemsenf6486ce2016-09-16 19:21:36 -070040 bool regen_debug;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090041 bool regen_ignoring_kati_binary;
42 bool use_find_emulator;
Dan Willemsene41c7552017-02-22 14:31:16 -080043 bool color_warnings;
Dan Willemsencf1fa882018-06-10 12:48:47 -070044 bool no_builtin_rules;
Dan Willemsen64c31bd2018-09-26 14:10:40 -070045 bool no_ninja_prelude;
Dan Willemsenf63a3fd2017-04-27 23:39:57 -070046 bool werror_find_emulator;
47 bool werror_overriding_commands;
Dan Willemsen6aafee62018-06-10 12:48:47 -070048 bool warn_implicit_rules;
49 bool werror_implicit_rules;
50 bool warn_suffix_rules;
51 bool werror_suffix_rules;
Dan Willemsen40f26e12019-01-21 12:32:18 -080052 bool top_level_phony;
Dan Willemsen8b551c52018-06-08 16:39:23 -070053 bool warn_real_to_phony;
54 bool werror_real_to_phony;
55 bool warn_phony_looks_real;
56 bool werror_phony_looks_real;
Dan Willemsena42898a2018-06-09 12:09:27 -070057 bool werror_writable;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090058 const char* goma_dir;
59 const char* ignore_dirty_pattern;
Colin Crossf23ae8c2015-11-12 17:05:32 -080060 const char* no_ignore_dirty_pattern;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090061 const char* ignore_optional_include_pattern;
62 const char* makefile;
63 const char* ninja_dir;
64 const char* ninja_suffix;
Shinichiro Hamaji1a444a82016-02-16 13:49:49 +090065 int num_cpus;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090066 int num_jobs;
67 int remote_num_jobs;
68 vector<const char*> subkati_args;
69 vector<Symbol> targets;
70 vector<StringPiece> cl_vars;
Dan Willemsena42898a2018-06-09 12:09:27 -070071 vector<string> writable;
Shinichiro Hamaji003d06e2015-09-09 18:22:04 +090072
73 void Parse(int argc, char** argv);
74};
75
76extern Flags g_flags;
Shinichiro Hamaji08808d32015-06-26 08:02:45 +090077
78#endif // FLAGS_H_