diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-30 15:30:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-30 15:30:39 +0200 |
commit | e879c347f4f05dac5405bcc45ae2d5c9dde5447c (patch) | |
tree | 8ad9956bf66a3b28c9628608e8b9c9787e2c34a5 /build2/parser.cxx | |
parent | dee70af1d3b6ca4caf1027b79eb471b28624fff8 (diff) |
Add support for target visibility, use for dist, test, install
This means we can no longer write:
install = false
Now it should be:
*: install = false
Diffstat (limited to 'build2/parser.cxx')
-rw-r--r-- | build2/parser.cxx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx index 689db66..1bc3519 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -488,6 +488,11 @@ namespace build2 { // Scope variable. // + if (var.visibility == variable_visibility::target) + fail (ploc) << "variable " << var << " has target " + << "visibility but assigned in a scope" << + info << "consider changing to '.../*: " << var << "'"; + enter_scope sg (*this, move (n.dir)); variable (t, tt, var, att); } @@ -604,13 +609,11 @@ namespace build2 // if (att == type::prepend && lhs.extra == 2) fail (at) << "prepend to a previously appended target " - << "type/pattern-specific variable " - << var.name; + << "type/pattern-specific variable " << var; if (att == type::append && lhs.extra == 1) fail (at) << "append to a previously prepended target " - << "type/pattern-specific variable " - << var.name; + << "type/pattern-specific variable " << var; // Do untyped prepend/append. // @@ -620,7 +623,7 @@ namespace build2 if (lhs.extra != 0 && lhs.type != nullptr) fail (at) << "typed prepend/append to target type/pattern-" - << "specific variable " << var.name; + << "specific variable " << var; } } @@ -723,6 +726,11 @@ namespace build2 // variable_attributes (var); + if (var.visibility == variable_visibility::target) + fail (nloc) << "variable " << var << " has target visibility but " + << "assigned in a scope" << + info << "consider changing to '*: " << var << "'"; + variable (t, tt, var, tt); if (tt == type::newline) @@ -1532,7 +1540,7 @@ namespace build2 if (var.type == nullptr) var.type = type; else if (var.type != type) - fail (l) << "changing variable " << var.name << " type from " + fail (l) << "changing variable " << var << " type from " << var.type->name << " to " << type->name; } } @@ -2371,7 +2379,7 @@ namespace build2 // @@ TMP this isn't proving to be particularly useful. // //if (var.name.find ('.') != string::npos) - //fail (loc) << "undefined/null namespace variable " << var.name; + //fail (loc) << "undefined/null namespace variable " << var; // See if we should set the NULL indicator. // |