From 9d5a9628d22bae7c6a4f9688e8efdfc2cbb5c4fb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 7 Jan 2024 12:12:19 +0200 Subject: Add {bin,c,cxx}.types submodules that only register target types --- libbuild2/cc/module.cxx | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'libbuild2/cc') diff --git a/libbuild2/cc/module.cxx b/libbuild2/cc/module.cxx index eed7db1..70624a2 100644 --- a/libbuild2/cc/module.cxx +++ b/libbuild2/cc/module.cxx @@ -11,10 +11,7 @@ #include -#include // pc* - #include -#include #include @@ -989,43 +986,7 @@ namespace build2 // Register target types and configure their "installability". // - bool install_loaded (cast_false (rs["install.loaded"])); - - { - using namespace install; - - // Note: not registering x_obj or x_asp (they are registered - // seperately by the respective optional submodules). - // - rs.insert_target_type (x_src); - - auto insert_hdr = [&rs, install_loaded] (const target_type& tt) - { - rs.insert_target_type (tt); - - // Install headers into install.include. - // - if (install_loaded) - install_path (rs, tt, dir_path ("include")); - }; - - // Note: module (x_mod) is in x_hdrs. - // - for (const target_type* const* ht (x_hdrs); *ht != nullptr; ++ht) - insert_hdr (**ht); - - // Also register the C header for C-derived languages. - // - if (*x_hdrs != &h::static_type) - insert_hdr (h::static_type); - - rs.insert_target_type (); - rs.insert_target_type (); - rs.insert_target_type (); - - if (install_loaded) - install_path (rs, dir_path ("pkgconfig")); - } + load_module (rs, rs, (string (x) += ".types"), loc); // Register rules. // @@ -1123,7 +1084,7 @@ namespace build2 // them in case they depend on stuff that we need to install (see the // install rule implementations for details). // - if (install_loaded) + if (cast_false (rs["install.loaded"])) { // Note: we rely quite heavily in these rule implementations that // these are the only target types they are registered for. -- cgit v1.1