From 1eff61b00307b9f0081dbf062f6f55e5d4771e52 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Jan 2018 10:13:19 +0200 Subject: Add cxx.module_name alias for cc.module_name --- build2/cc/compile.cxx | 7 ++++--- build2/cxx/init.cxx | 4 ++++ doc/manual.cli | 6 +++--- tests/cc/modules/testscript | 4 ++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 47953ee..3ae1e94 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -3657,12 +3657,13 @@ namespace build2 { if (p.is_a (*x_mod)) // Got to be there. { - fail (relative (src)) << "failed to correctly guess module " - << "name from " << p << + fail (relative (src)) + << "failed to correctly guess module name from " << p << info << "guessed: " << in << info << "actual: " << mn << info << "consider adjusting module interface file names or" << - info << "consider specifying module name with cc.module_name"; + info << "consider specifying module name with " << x + << ".module_name"; } } } diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx index 9870d84..91e37e7 100644 --- a/build2/cxx/init.cxx +++ b/build2/cxx/init.cxx @@ -429,6 +429,10 @@ namespace build2 v.insert ("cxx.target.class") }; + // Alias some cc. variables as cxx. + // + v.insert_alias (d.c_module_name, "cxx.module_name"); + assert (mod == nullptr); config_module* m (new config_module (move (d))); mod.reset (m); diff --git a/doc/manual.cli b/doc/manual.cli index 1858467..6dd7002 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -1307,12 +1307,12 @@ since our module names can still be guessed correctly and unambiguously. If a guess turns out to be incorrect, the implementation issues diagnostics and exits with an error before attempting to build anything. To resolve this situation we can either adjust the interface file names or we can specify the -module name explicitly with the \c{cc.module_name} variable. The latter +module name explicitly with the \c{cxx.module_name} variable. The latter approach can be used with interface file names that have nothing in common with module names, for example: \ -mxx{foobar}@./: cc.module_name = hello +mxx{foobar}@./: cxx.module_name = hello \ Note also that standard library modules (\c{std} and \c{std.*}) are treated @@ -1327,7 +1327,7 @@ For example: \ exe{hello}: cxx{driver} {mxx cxx}{hello} mxx{std-core} -mxx{std-core}@./: cc.module_name = std.core +mxx{std-core}@./: cxx.module_name = std.core \ When C++ modules are enabled and available, the build system makes sure the diff --git a/tests/cc/modules/testscript b/tests/cc/modules/testscript index 754a7dc..a2b057d 100644 --- a/tests/cc/modules/testscript +++ b/tests/cc/modules/testscript @@ -162,7 +162,7 @@ $* test clean <>EOE != 0 info: guessed: bar.core info: actual: foo.core info: consider adjusting module interface file names or - info: consider specifying module name with cc.module_name + info: consider specifying module name with cxx.module_name EOE : library -- cgit v1.1