aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/scope.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-07-02 07:51:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-07-02 07:51:07 +0200
commit4bab5c56cd1c91a928af73e0d428d8cc361600f4 (patch)
treedeccae44ecd64dae3566e902a3ee4fd8b7353e1a /libbuild2/scope.ixx
parent47d266e501522ccb217ec3a7aeebdfb54f3b30fb (diff)
Cache project name in root_extra
Diffstat (limited to 'libbuild2/scope.ixx')
-rw-r--r--libbuild2/scope.ixx7
1 files changed, 5 insertions, 2 deletions
diff --git a/libbuild2/scope.ixx b/libbuild2/scope.ixx
index a3a417f..01d239b 100644
--- a/libbuild2/scope.ixx
+++ b/libbuild2/scope.ixx
@@ -162,8 +162,11 @@ namespace build2
inline const project_name&
project (const scope& rs)
{
- auto l (rs[rs.ctx.var_project]);
- return l ? cast<project_name> (l) : empty_project_name;
+ assert (rs.root_extra != nullptr && rs.root_extra->project);
+
+ return *rs.root_extra->project != nullptr
+ ? **rs.root_extra->project
+ : empty_project_name;
}
inline const project_name&