aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-10-17 12:12:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-10-17 12:12:26 +0200
commitb3eaf577762078b097f5e68904aa15c4655c80df (patch)
tree1b9052d28587a529fecbc1e4d2b0942af40b9d69
parentc6633f888517b685007e5c4cb5fb43de5cbc02b5 (diff)
Adjust stack size on Windows
-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.
#