aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/link-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-05-02 15:02:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-05-02 15:02:02 +0200
commit4b9de5c80934772dbc5503e65e265da452ca356a (patch)
tree18678181705b6f3346038f72003f915c35b676a9 /build2/cc/link-rule.cxx
parenta0a8eaabb234d880464f389f7dee89e430c84b32 (diff)
Add support for different backlinking modes, use for Windows DLL assembly
Diffstat (limited to 'build2/cc/link-rule.cxx')
-rw-r--r--build2/cc/link-rule.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx
index 4d98e5f..358a835 100644
--- a/build2/cc/link-rule.cxx
+++ b/build2/cc/link-rule.cxx
@@ -503,6 +503,20 @@ namespace build2
t.out,
string ()));
+ // By default our backlinking logic will try to symlink the
+ // directory and it can even be done on Windows using junctions.
+ // The problem is the Windows DLL assembly "logic" refuses to
+ // recognize a junction as a valid assembly for some reason. So we
+ // are going to resort to copy-link (i.e., a real directory with a
+ // bunch on links).
+ //
+ // Interestingly, the directory symlink works just fine under
+ // Wine. So we only resort to copy-link'ing if we are running
+ // on Windows.
+ //
+#ifdef _WIN32
+ dir.target->assign (var_backlink) = "copy";
+#endif
match_recipe (dir, group_recipe); // Set recipe and unlock.
}
}