From 9a00b8ccfef1d13088be2d76fefcb320c269732a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Jun 2017 13:24:59 +0200 Subject: Add extra support for symbol exporting in modularized projects Since modules don't see each other's macros, we can use a single, keyword- like macro for dll-exporting that is managed by the build system (so no need for an "export" header). For example: cxx.features.symexport = true export __symexport void f (); --- build2/cxx/init.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'build2/cxx') diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx index 2c59f2c..53ee2d2 100644 --- a/build2/cxx/init.cxx +++ b/build2/cxx/init.cxx @@ -55,8 +55,8 @@ namespace build2 return var_pool.rw (rs).insert (v, variable_visibility::project); }; - bool modules (false); auto& v_m (enter ("cxx.features.modules")); //bool concepts (false); auto& v_c (enter ("cxx.features.concepts")); + bool modules (false); auto& v_m (enter ("cxx.features.modules")); // Translate "latest" and "experimental" to the compiler/version- // appropriate option(s). @@ -429,8 +429,16 @@ namespace build2 if (!cast_false (rs["cxx.config.loaded"])) load_module (rs, rs, "cxx.config", loc, false, hints); + auto& vp (var_pool.rw (rs)); + bool modules (cast (rs["cxx.features.modules"])); + bool symexport ( + modules && + cast_false ( + rs[vp.insert ("cxx.features.symexport", + variable_visibility::project)])); + config_module& cm (*rs.modules.lookup ("cxx.config")); cc::data d { @@ -451,6 +459,7 @@ namespace build2 cm.tstd, modules, + symexport, cast_null (rs["pkgconfig.path"]), cast (rs[cm.x_sys_lib_dirs]), -- cgit v1.1