aboutsummaryrefslogtreecommitdiff
path: root/build/cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build/cxx')
-rw-r--r--build/cxx/link.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/build/cxx/link.cxx b/build/cxx/link.cxx
index f489a0d..7d6b15e 100644
--- a/build/cxx/link.cxx
+++ b/build/cxx/link.cxx
@@ -746,6 +746,7 @@ namespace build
scope& rs (t.root_scope ());
cstrings args;
string storage1;
+ strings rpaths;
if (lt == type::a)
{
@@ -767,6 +768,18 @@ namespace build
args.push_back ("-o");
args.push_back (relt.string ().c_str ());
+ if (auto l = t["bin.rpath"])
+ {
+ const auto& ps (as<strings> (*l));
+ rpaths.reserve (ps.size ()); // Make sure no reallocations.
+
+ for (const string& p: ps)
+ {
+ rpaths.push_back ("-Wl,-rpath," + p);
+ args.push_back (rpaths.back ().c_str ());
+ }
+ }
+
append_options (args, t, "cxx.loptions");
}