aboutsummaryrefslogtreecommitdiff
path: root/bpkg/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-04-19 13:25:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-04-19 13:25:23 +0200
commitabde2515c64816e7233d138c3f00e59213cb980e (patch)
tree30a78eda2103fb93c131fab6fc671d6a1f13bb72 /bpkg/buildfile
parent2b4c6a27deab202769d5d274a4c55bafd7b9dcc3 (diff)
Adjust build to match build system driver better
Diffstat (limited to 'bpkg/buildfile')
-rw-r--r--bpkg/buildfile30
1 files changed, 27 insertions, 3 deletions
diff --git a/bpkg/buildfile b/bpkg/buildfile
index 19fd4dc..0ba60dc 100644
--- a/bpkg/buildfile
+++ b/bpkg/buildfile
@@ -131,10 +131,34 @@ switch $cxx.class
if ($cxx.id == 'msvc' && $cxx.version.major == 19 && $cxx.version.minor < 10)
cxx.coptions += /wd4503
-# Make sure backtrace includes function names.
+# Similar option to the build system driver.
#
-if ($cxx.target.class == 'linux')
- cxx.loptions += -rdynamic
+switch $cxx.target.class
+{
+ case 'linux'
+ {
+ # Make sure backtrace includes function names.
+ #
+ if ($cc.stdlib == 'glibc')
+ cxx.loptions += -rdynamic
+
+ # Make sure we use RPATH and not RUNPATH since the latter messes up
+ # dlopen().
+ #
+ cxx.loptions += -Wl,--disable-new-dtags
+ }
+ 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")
+ }
+}
# Generated options parser.
#