diff options
author | Stefan Becker <stefanb@gpartner-nvidia.com> | 2016-04-07 13:29:23 +0300 |
---|---|---|
committer | Stefan Becker <stefanb@gpartner-nvidia.com> | 2016-04-12 12:31:46 +0300 |
commit | 29b9b7470cc33c2b7c4264f254335d788ef04c26 (patch) | |
tree | 021c5e8704caa412e83558a91b1bf8f6cc3a039e /eval.cc | |
parent | 167e1f750dfed276d50ad93ebf0ce0a1f6e6f9ac (diff) | |
download | android_build_kati-29b9b7470cc33c2b7c4264f254335d788ef04c26.tar.gz android_build_kati-29b9b7470cc33c2b7c4264f254335d788ef04c26.tar.bz2 android_build_kati-29b9b7470cc33c2b7c4264f254335d788ef04c26.zip |
[C++] Honor "override" when setting global variable
Regression when compared to GNU make behaviour.
Test case:
$ cat Makefile.override-failure
$(info VAR: '$(VAR)')
override VAR := test
$(info VAR: '$(VAR)')
override VAR := test-new
$(info VAR: '$(VAR)')
VAR := test-should-not-work
$(info VAR: '$(VAR)')
$ make -f Makefile.override-failure
VAR: ''
VAR: 'test'
VAR: 'test-new'
VAR: 'test-new'
make: *** No targets. Stop.
$ ckati -c --warn -f Makefile.override-failure
VAR: ''
VAR: 'test'
VAR: 'test'
VAR: 'test'
*** No targets.
Fixes https://github.com/google/kati/issues/50
Change-Id: I9c4185c30cfcf5602da7e0ac98b7e9c420788005
Diffstat (limited to 'eval.cc')
-rw-r--r-- | eval.cc | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -101,7 +101,8 @@ void Evaluator::EvalAssign(const AssignStmt* stmt) { Var* rhs = EvalRHS(lhs, stmt->rhs, stmt->orig_rhs, stmt->op, stmt->directive == AssignDirective::OVERRIDE); if (rhs) - lhs.SetGlobalVar(rhs); + lhs.SetGlobalVar(rhs, + stmt->directive == AssignDirective::OVERRIDE); } void Evaluator::EvalRule(const RuleStmt* stmt) { |