diff options
author | LinuxUserGD <hugegameartgd@gmail.com> | 2024-02-18 19:10:23 +0100 |
---|---|---|
committer | LinuxUserGD <hugegameartgd@gmail.com> | 2024-02-18 21:42:05 +0100 |
commit | f1a677fb4c47e32633809ccadc7ccde6703767b2 (patch) | |
tree | 4dfbf5aa2f6ddf56f51a95192d359893c08e1274 /platform/linuxbsd/detect.py | |
parent | 5f05e2b9b1a3fedcdd7ecb2ab976a2687fd6f19a (diff) | |
download | redot-engine-f1a677fb4c47e32633809ccadc7ccde6703767b2.tar.gz |
Disable the crash handler if execinfo=no scons option is set
Diffstat (limited to 'platform/linuxbsd/detect.py')
-rw-r--r-- | platform/linuxbsd/detect.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index 8fbd8b10b1..6cd5ea9f41 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -50,7 +50,7 @@ def get_opts(): BoolVariable("wayland", "Enable Wayland display", True), BoolVariable("libdecor", "Enable libdecor support", True), BoolVariable("touch", "Enable touch events", True), - BoolVariable("execinfo", "Use libexecinfo on systems where glibc is not available", False), + BoolVariable("execinfo", "Use libexecinfo on systems where glibc is not available", None), ] @@ -487,14 +487,20 @@ def configure(env: "SConsEnvironment"): if platform.system() == "Linux": env.Append(LIBS=["dl"]) - if not env["execinfo"] and platform.libc_ver()[0] != "glibc": + if platform.libc_ver()[0] != "glibc": # The default crash handler depends on glibc, so if the host uses # a different libc (BSD libc, musl), fall back to libexecinfo. - print("Note: Using `execinfo=yes` for the crash handler as required on platforms where glibc is missing.") - env["execinfo"] = True + if not "execinfo" in env: + print("Note: Using `execinfo=yes` for the crash handler as required on platforms where glibc is missing.") + env["execinfo"] = True - if env["execinfo"]: - env.Append(LIBS=["execinfo"]) + if env["execinfo"]: + env.Append(LIBS=["execinfo"]) + env.Append(CPPDEFINES=["CRASH_HANDLER_ENABLED"]) + else: + print("Note: Using `execinfo=no` disables the crash handler on platforms where glibc is missing.") + else: + env.Append(CPPDEFINES=["CRASH_HANDLER_ENABLED"]) if platform.system() == "FreeBSD": env.Append(LINKFLAGS=["-lkvm"]) |