diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-05 10:13:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-05 15:10:01 +0200 |
commit | 1eff61b00307b9f0081dbf062f6f55e5d4771e52 (patch) | |
tree | c8ade74e997b97dcefaafa7dd3df6b1ba23031c7 | |
parent | d262f63ce5a7c3810abde1f66ee3bb99d56acdd0 (diff) |
Add cxx.module_name alias for cc.module_name
-rw-r--r-- | build2/cc/compile.cxx | 7 | ||||
-rw-r--r-- | build2/cxx/init.cxx | 4 | ||||
-rw-r--r-- | doc/manual.cli | 6 | ||||
-rw-r--r-- | 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<string> ("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 <<EOI ln -s ../core.mxx ../../core.cxx ../../driver.cxx ./; $* test clean <<EOO exe{test}: cxx{driver core} mxx{core baz} - mxx{baz}@./: cc.module_name = foo.core + mxx{baz}@./: cxx.module_name = foo.core EOO } @@ -182,7 +182,7 @@ $* test &*.d &*.ii <'exe{test}: cxx{driver} mxx{core}' 2>>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 |