From b3eaf577762078b097f5e68904aa15c4655c80df Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Oct 2017 12:12:26 +0200 Subject: Adjust stack size on Windows --- build2/buildfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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. # -- cgit v1.1