aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/buildfile14
1 files changed, 14 insertions, 0 deletions
diff --git a/build2/buildfile b/build2/buildfile
index 2bb1afa..ce75f07 100644
--- a/build2/buildfile
+++ b/build2/buildfile
@@ -19,6 +19,20 @@ obj{b context}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\"
if ($cxx.target.class != "windows")
cxx.libs += -lpthread
+else
+{
+ # Adjust stack size (affects all threads).
+ #
+ if ($cxx.target.cpu == "x86_64")
+ stack_size = 8388608 # 8M
+ else
+ stack_size = 4194304 # 4M
+
+ if ($cxx.id == 'msvc')
+ cxx.loptions += "/STACK:$stack_size"
+ else
+ cxx.loptions += "-Wl,--stack,$stack_size"
+}
# Generated options parser.
#