aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-14 13:15:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-14 13:35:38 +0200
commitf0402b95b1104f85eea6c2553741765e241e5e26 (patch)
tree2b3e562046bed6677647d7257758c0888010cc9d
parentba357a5452cb4f91eecdc09b171d99acff39cb32 (diff)
Enable libs_paths symlinking logic on Windows
This should currently be noop since all the paths are set to empty.
-rw-r--r--build2/cc/install-rule.cxx7
-rw-r--r--build2/cc/link-rule.cxx46
2 files changed, 28 insertions, 25 deletions
diff --git a/build2/cc/install-rule.cxx b/build2/cc/install-rule.cxx
index ce2424c..f8058d7 100644
--- a/build2/cc/install-rule.cxx
+++ b/build2/cc/install-rule.cxx
@@ -180,8 +180,7 @@ namespace build2
static_assert (sizeof (link_rule::libs_paths) <= target::data_size,
"insufficient space");
- file* f;
- if ((f = t.is_a<libs> ()) != nullptr && tclass != "windows")
+ if (file* f = t.is_a<libs> ())
{
if (!f->path ().empty ()) // Not binless.
{
@@ -203,7 +202,7 @@ namespace build2
{
bool r (false);
- if (t.is_a<libs> () && tclass != "windows")
+ if (t.is_a<libs> ())
{
// Here we may have a bunch of symlinks that we need to install.
//
@@ -235,7 +234,7 @@ namespace build2
{
bool r (false);
- if (t.is_a<libs> () && tclass != "windows")
+ if (t.is_a<libs> ())
{
// Here we may have a bunch of symlinks that we need to uninstall.
//
diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx
index f8cbfe3..c9e4ee3 100644
--- a/build2/cc/link-rule.cxx
+++ b/build2/cc/link-rule.cxx
@@ -2573,7 +2573,7 @@ namespace build2
return true;
};
- // Doesn't follow symlinks.
+ // Note: doesn't follow symlinks.
//
path_search (p, rm, dir_path () /* start */, path_match_flags::none);
}
@@ -2810,17 +2810,18 @@ namespace build2
run (rl, args);
}
+ // For Windows generate (or clean up) rpath-emulating assembly.
+ //
if (tclass == "windows")
{
- // For Windows generate (or clean up) rpath-emulating assembly.
- //
if (lt.executable ())
windows_rpath_assembly (t, bs, a, li,
cast<string> (rs[x_target_cpu]),
rpath_timestamp,
scratch);
}
- else if (lt.shared_library ())
+
+ if (lt.shared_library ())
{
// For shared libraries we may need to create a bunch of symlinks.
//
@@ -2864,7 +2865,8 @@ namespace build2
// Apple ar (from cctools) for some reason truncates fractional
// seconds when running on APFS (HFS has a second resolution so it's
// not an issue there). This can lead to object files being newer than
- // the archive, which is naturally bad news. Filed as bug 49604334.
+ // the archive, which is naturally bad news. Filed as bug 49604334,
+ // reportedly fixed in Xcode 11 beta 5.
//
// Note that this block is not inside #ifdef __APPLE__ because we
// could be cross-compiling, theoretically. We also make sure we use
@@ -2909,22 +2911,7 @@ namespace build2
else
{
if (tclass != "windows")
- {
- if (lt.shared_library ())
- {
- // Here we can have a bunch of symlinks that we need to remove. If
- // the paths are empty, then they will be ignored.
- //
- const libs_paths& paths (md.libs_data);
-
- extras = {".d",
- paths.link.string ().c_str (),
- paths.soname.string ().c_str (),
- paths.interm.string ().c_str ()};
- }
-
- // For executable and static library it's the default.
- }
+ ; // Everything is the default.
else if (tsys == "mingw32")
{
if (lt.executable ())
@@ -2965,6 +2952,23 @@ namespace build2
#ifdef _WIN32
extras.push_back (".t"); // Options file.
#endif
+ // For shared libraries we may have a bunch of symlinks that we need
+ // to remove.
+ //
+ if (lt.shared_library ())
+ {
+ const libs_paths& lp (md.libs_data);
+
+ auto add = [&extras] (const path& p)
+ {
+ if (!p.empty ())
+ extras.push_back (p.string ().c_str ());
+ };
+
+ add (lp.link);
+ add (lp.soname);
+ add (lp.interm);
+ }
}
return perform_clean_extra (a, t, extras, adhoc_extras);