From 0fcc1a694d1b834921b7f931018ff39fa396027a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Nov 2017 13:30:49 +0200 Subject: 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. --- build2/cc/pkgconfig.cxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'build2/cc/pkgconfig.cxx') 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_. = + // _module_. = // 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; } } } -- cgit v1.1