aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/utility.ixx
blob: bc9cd0562512d0003ee2d618a0d4a0990889bc73 (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
// file      : build2/cc/utility.ixx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

namespace build2
{
  namespace cc
  {
    inline otype
    compile_type (const target& t)
    {
      return
        t.is_a<bin::obje> () ? otype::e :
        t.is_a<bin::obja> () ? otype::a :
        otype::s;
    }

    inline otype
    link_type (const target& t)
    {
      return
        t.is_a<exe> ()       ? otype::e :
        t.is_a<bin::liba> () ? otype::a :
        otype::s;
    }
  }
}