diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-11-27 13:30:49 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-11-27 13:30:49 +0200 |
commit | 0fcc1a694d1b834921b7f931018ff39fa396027a (patch) | |
tree | 1a722035b6a4e2c26c4bdba99a2ad173d479721e | |
parent | 0d34b2f7692aba066213c038b810623c216b6980 (diff) |
Add cxx_ prefix to module-related pkg-config variables
This way we can assume that those are the C++ (language) modules built by the
cxx (build system) module.
-rw-r--r-- | build2/cc/pkgconfig.cxx | 22 | ||||
-rw-r--r-- | doc/manual.cli | 12 |
2 files changed, 16 insertions, 18 deletions
diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx index 13ba401..1ad9f77 100644 --- a/build2/cc/pkgconfig.cxx +++ b/build2/cc/pkgconfig.cxx @@ -944,7 +944,7 @@ namespace build2 auto parse_modules = [&trace, &next, this] (const pkgconf& pc, prerequisites& ps) { - string mstr (pc.variable ("modules")); + string mstr (pc.variable ("cxx_modules")); string m; for (size_t b (0), e (0); !(m = next (mstr, b, e)).empty (); ) @@ -956,7 +956,7 @@ namespace build2 p == 0 || // Empty name. p == m.size () - 1) // Empty path. fail << "invalid module information in '" << mstr << "'" << - info << "while parsing pkg-config --variable=modules " + info << "while parsing pkg-config --variable=cxx_modules " << pc.path; string mn (m, 0, p); @@ -965,13 +965,10 @@ namespace build2 // Extract module properties, if any. // - string pp (pc.variable ("module_preprocessed." + mn)); - string se (pc.variable ("module_symexport." + mn)); + string pp (pc.variable ("cxx_module_preprocessed." + mn)); + string se (pc.variable ("cxx_module_symexport." + mn)); - // For now we assume these are C++ modules. There aren't any other - // kind currently but if there were we would need to encode this - // information somehow (e.g., cxx_modules vs c_modules variable - // names). + // For now there are only C++ modules. // auto tl ( targets.insert_locked ( @@ -1391,7 +1388,7 @@ namespace build2 if (!modules.empty ()) { os << endl - << "modules ="; + << "cxx_modules ="; // Module names shouldn't require escaping. // @@ -1402,15 +1399,16 @@ namespace build2 // Module-specific properties. The format is: // - // module_<property>.<module> = <value> + // <lang>_module_<property>.<module> = <value> // for (const module& m: modules) { if (!m.pp.empty ()) - os << "module_preprocessed." << m.name << " = " << m.pp << endl; + os << "cxx_module_preprocessed." << m.name << " = " << m.pp + << endl; if (m.symexport) - os << "module_symexport." << m.name << " = true" << endl; + os << "cxx_module_symexport." << m.name << " = true" << endl; } } } diff --git a/doc/manual.cli b/doc/manual.cli index f3f9023..1858467 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -1455,8 +1455,8 @@ header-like search mechanism (\c{-I} paths, etc.), an explicit list of exported modules is provided for each library in its \c{.pc} (\c{pkg-config}) file. -Specifically, the library's \c{.pc} file contains the \c{modules} variable -that lists all the exported modules in the \c{<name>=<path>} form with +Specifically, the library's \c{.pc} file contains the \c{cxx_modules} variable +that lists all the exported C++ modules in the \c{<name>=<path>} form with \c{<name>} being the module's C++ name and \c{<path>} \- the module interface file's absolute path. For example: @@ -1466,15 +1466,15 @@ Version: 1.0.0 Cflags: Libs: -L/usr/lib -lhello -modules = hello.core=/usr/include/hello/core.mxx hello.extra=/usr/include/hello/extra.mxx +cxx_modules = hello.core=/usr/include/hello/core.mxx hello.extra=/usr/include/hello/extra.mxx \ Additional module properties are specified with variables in the -\c{module_<property>.<name>} form, for example: +\c{cxx_module_<property>.<name>} form, for example: \ -module_symexport.hello.core = true -module_preprocessed.hello.core = all +cxx_module_symexport.hello.core = true +cxx_module_preprocessed.hello.core = all \ Currently, two properties are defined. The \c{symexport} property with the |