aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-11-26 21:28:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-11-26 21:28:46 +0300
commit9535f4c536248b08ae5e7a79312e0b3ae670fa68 (patch)
tree3573671aa18b183d5c5ea53a2598b20eb016f9a6
parent8fbc673998ed0946403b0c89397d68ab93a1c49c (diff)
Use switch in buildfile
-rw-r--r--build2/buildfile26
1 files changed, 12 insertions, 14 deletions
diff --git a/build2/buildfile b/build2/buildfile
index fb74968..7b9bb7a 100644
--- a/build2/buildfile
+++ b/build2/buildfile
@@ -21,9 +21,9 @@ exe{b}: {hxx ixx txx cxx}{** -b-options} {hxx ixx cxx}{b-options} $libs
#
obj{b}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\"
-if ($cxx.target.class != 'windows')
+switch $cxx.target.class
{
- if ($cxx.target.class == 'linux')
+ case 'linux'
{
# Make sure backtrace includes function names.
#
@@ -35,19 +35,17 @@ if ($cxx.target.class != 'windows')
#
cxx.loptions += -Wl,--disable-new-dtags
}
-}
-else
-{
- # Adjust stack size (affects all threads).
- #
- if ($cxx.target.cpu == "x86_64")
- stack_size = 8388608 # 8M
- else
- stack_size = 4194304 # 4M
+ case 'windows'
+ {
+ # Adjust stack size (affects all threads).
+ #
+ # 8M 4M
+ stack_size = ($cxx.target.cpu == "x86_64" ? 8388608 : 4194304)
- cxx.loptions += ($cxx.target.system == 'win32-msvc' \
- ? "/STACK:$stack_size" \
- : "-Wl,--stack,$stack_size")
+ cxx.loptions += ($cxx.target.system == 'win32-msvc' \
+ ? "/STACK:$stack_size" \
+ : "-Wl,--stack,$stack_size")
+ }
}
# Generated options parser.