From 4a74374e20d275722067e773d7ea99fc85ca2a0b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 May 2017 14:11:50 +0200 Subject: Diagnose lack of module support in extract_modules() --- build2/cc/compile.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'build2/cc/compile.cxx') diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index ce96e00..c7fc3ea 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -610,9 +610,8 @@ namespace build2 dd.close (); - // If C++ modules support is enabled then we need to extract the - // module dependency information in addition to header dependencies - // above. + // Extract the module dependency information in addition to header + // dependencies above. // if (u) // @@ TMP (depdb validation similar to extract_headers()). { @@ -2207,8 +2206,16 @@ namespace build2 throw failed (); } - if (!tu.module_name.empty () || !tu.module_imports.empty ()) - fail << "module support not yet implemented"; + //@@ TODO: if bmi{}, make sure module_name is not empty. + + if (tu.module_name.empty () && tu.module_imports.empty ()) + return; + + // Modules are used by this translation unit. Make sure module support + // is enabled. + // + if (!modules) + fail << "modules support not enabled or unavailable"; } // Filter cl.exe noise (msvc.cxx). -- cgit v1.1