From a14b9bc18431c6aed8441261d28b6ff20bd25935 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Apr 2019 14:44:32 +0200 Subject: Initial take on header unit and include translation support --- build2/cc/module.cxx | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'build2/cc/module.cxx') diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx index 824eee7..a8f25c6 100644 --- a/build2/cc/module.cxx +++ b/build2/cc/module.cxx @@ -463,6 +463,22 @@ namespace build2 rs.assign (x_libs) += cast_null ( config::optional (rs, config_x_libs)); + // config.x.header_units + // + // It's still fuzzy whether specifying (or maybe tweaking) this list in + // the configuration will be a common thing to do so for now we use + // omitted. It's also probably too early to think whether we should have + // the cc.* version and what the semantics should be. + // + if (x_header_units != nullptr) + { + lookup l (config::omitted (rs, *config_x_header_units).first); + + // @@ MODHDR: if(modules) ? + // + rs.assign (x_header_units) += cast_null (l); + } + // Load cc.core.config. // if (!cast_false (rs["cc.core.config.loaded"])) @@ -487,6 +503,23 @@ namespace build2 if (!cast_false (rs["cc.core.loaded"])) load_module (rs, rs, "cc.core", loc); + // Process, sort, and cache (in this->hdr_units) the header units list. + // Keep the cache NULL if unused or empty. + // + // @@ MODHDR TODO: translate <> to absolute paths. + // @@ MODHDR TODO: support exclusions entries (e.g., -)? + // + if (modules && x_header_units != nullptr) + { + strings* v (cast_null (rs.assign (x_header_units))); + + if (v != nullptr && !v->empty ()) + { + sort (v->begin (), v->end ()); + hdr_units = v; + } + } + // Register target types and configure their "installability". // bool install_loaded (cast_false (rs["install.loaded"])); @@ -548,13 +581,25 @@ namespace build2 r.insert (perform_clean_id, x_compile, cr); r.insert (configure_update_id, x_compile, cr); + r.insert (perform_update_id, x_compile, cr); + r.insert (perform_clean_id, x_compile, cr); + r.insert (configure_update_id, x_compile, cr); + r.insert (perform_update_id, x_compile, cr); r.insert (perform_clean_id, x_compile, cr); r.insert (configure_update_id, x_compile, cr); + r.insert (perform_update_id, x_compile, cr); + r.insert (perform_clean_id, x_compile, cr); + r.insert (configure_update_id, x_compile, cr); + r.insert (perform_update_id, x_compile, cr); r.insert (perform_clean_id, x_compile, cr); r.insert (configure_update_id, x_compile, cr); + + r.insert (perform_update_id, x_compile, cr); + r.insert (perform_clean_id, x_compile, cr); + r.insert (configure_update_id, x_compile, cr); } r.insert (perform_update_id, x_link, lr); -- cgit v1.1