aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/common.ixx
blob: ce28890195d7347177e82c2c73be966e5cde8f46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// file      : libbuild2/cc/common.ixx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

namespace build2
{
  namespace cc
  {
    inline const scope* data::
    effective_internal_scope (const scope& bs) const
    {
      if (internal_scope == nullptr)
        return nullptr;
      else
      {
        const string& s (*internal_scope);

        if (s == "current")
          return internal_scope_current;
        else if (s == "base")
          return &bs;
        else if (s == "root")
          return bs.root_scope ();
        else if (s == "bundle")
          return bs.bundle_scope ();
        else if (s == "strong")
          return bs.strong_scope ();
        else if (s == "weak")
          return bs.weak_scope ();
        else
          return nullptr;
      }
    }
  }
}