diff options
Diffstat (limited to 'build2/cc/utility.ixx')
-rw-r--r-- | build2/cc/utility.ixx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/build2/cc/utility.ixx b/build2/cc/utility.ixx new file mode 100644 index 0000000..e7eb565 --- /dev/null +++ b/build2/cc/utility.ixx @@ -0,0 +1,33 @@ +// file : build2/cc/utility.ixx -*- C++ -*- +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +namespace build2 +{ + namespace cc + { + inline ostream& + operator<< (ostream& os, lang l) + { + return os << (l == lang::c ? "C" : "C++"); + } + + inline otype + compile_type (target& t) + { + return + t.is_a<bin::obje> () ? otype::e : + t.is_a<bin::obja> () ? otype::a : + otype::s; + } + + inline otype + link_type (target& t) + { + return + t.is_a<bin::exe> () ? otype::e : + t.is_a<bin::liba> () ? otype::a : + otype::s; + } + } +} |