From d52de69d635ce3fc840fc15b9db4f395d0763aed Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 8 Jun 2017 18:51:45 +0200 Subject: Implement rule chaining for modules --- build2/cc/utility.ixx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'build2/cc/utility.ixx') diff --git a/build2/cc/utility.ixx b/build2/cc/utility.ixx index b15791ad..d372dacf 100644 --- a/build2/cc/utility.ixx +++ b/build2/cc/utility.ixx @@ -27,5 +27,23 @@ namespace build2 t.is_a () ? otype::a : otype::s; } + + inline compile_target_types + compile_types (otype t) + { + using namespace bin; + + const target_type* o (nullptr); + const target_type* m (nullptr); + + switch (t) + { + case otype::e: o = &obje::static_type; m = &bmie::static_type; break; + case otype::a: o = &obja::static_type; m = &bmia::static_type; break; + case otype::s: o = &objs::static_type; m = &bmis::static_type; break; + } + + return compile_target_types {*o, *m}; + } } } -- cgit