From e3839b800a9ab1bc4824b742ccaef7ce3d59c291 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Jul 2016 15:33:43 +0200 Subject: Reimplement Windows rpath emulation using embedded manifests As a bonus, everyone now gets a sane default manifest. --- build2/cxx/module.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'build2/cxx/module.cxx') diff --git a/build2/cxx/module.cxx b/build2/cxx/module.cxx index 28892cf..caeea9b 100644 --- a/build2/cxx/module.cxx +++ b/build2/cxx/module.cxx @@ -256,6 +256,9 @@ namespace build2 } } + const string& tsys (cast (r["cxx.target.system"])); + const string& tclass (cast (r["cxx.target.class"])); + // Initialize the bin module. Only do this if it hasn't already been // loaded so that we don't overwrite user's bin.* settings. // @@ -274,6 +277,15 @@ namespace build2 info << "cxx.target is " << ct; } + // If our target is MinGW, then we will need the resource compiler + // (windres) in order to embed the manifest. + // + if (tsys == "mingw32") + { + if (!cast_false (b["bin.rc.loaded"])) + load_module ("bin.rc", r, b, loc, false, bin_hints); + } + // Register target types. // { @@ -329,8 +341,6 @@ namespace build2 r.insert (perform_install_id, "cxx.install", install::instance); } - - // Configure "installability" of our target types. // using namespace install; @@ -342,8 +352,6 @@ namespace build2 // Create additional target types for certain target platforms. // - const string& tclass (cast (r["cxx.target.class"])); - if (tclass == "windows") { const target_type& dll (b.derive_target_type ("dll").first); -- cgit v1.1