aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/link-rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r--libbuild2/cc/link-rule.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index 76d8418..d8f22d4 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -1266,6 +1266,21 @@ namespace build2
if (wasm.path ().empty ())
wasm.derive_path ();
+
+ // If we have -pthread then we get additional .worker.js file
+ // which is used for thread startup. In a somewhat hackish way we
+ // represent it as an exe{} member to make sure it gets installed
+ // next to the main .js file.
+ //
+ if (find_option ("-pthread", cmode) ||
+ find_option ("-pthread", t, c_loptions) ||
+ find_option ("-pthread", t, x_loptions))
+ {
+ exe& worker (add_adhoc_member<exe> (t, "worker.js"));
+
+ if (worker.path ().empty ())
+ worker.derive_path ();
+ }
}
// Add VC's .pdb. Note that we are looking for the link.exe /DEBUG