From c3f6a9791d9b747a49dfd02602bb5662ba6e2783 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 27 Feb 2018 00:25:01 -0800 Subject: Add KATI_(deprecate|obsolete)_export Allow makefiles to mark the `export` and `unexport` keywords as deprecated or obsolete. In large builds like Android, we've got our own ways to set global environment variables, it's very unlikely that individual makefiles need to set an environment variable for every single rule. We expect to eventually add environment variables to the list of inputs that ninja checks to see if a command needs to run again (currently it just checks the timestamps and commandline). Reducing the ability for makefiles to export global variables per-configuration means that we're more likely to share compile steps between configurations. Change-Id: I8df0630ef264e39fd077b08dcac57e571ebe214f --- eval.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'eval.h') diff --git a/eval.h b/eval.h index e588f7e..4fb5f05 100644 --- a/eval.h +++ b/eval.h @@ -15,6 +15,7 @@ #ifndef EVAL_H_ #define EVAL_H_ +#include #include #include #include @@ -98,6 +99,16 @@ class Evaluator { } void DumpStackStats() const; + bool ExportDeprecated() const { return export_message_ && !export_error_; }; + bool ExportObsolete() const { return export_error_; }; + void SetExportDeprecated(StringPiece msg) { + export_message_.reset(new string(msg.as_string())); + } + void SetExportObsolete(StringPiece msg) { + export_message_.reset(new string(msg.as_string())); + export_error_ = true; + } + private: Var* EvalRHS(Symbol lhs, Value* rhs, @@ -139,6 +150,9 @@ class Evaluator { void* lowest_stack_; Loc lowest_loc_; + unique_ptr export_message_; + bool export_error_; + static unordered_set used_undefined_vars_; Symbol kati_readonly_; -- cgit v1.2.3