summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-05-13 15:42:07 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2024-04-22 16:19:37 +0300
commitc1b34672f95d03be104828679f606ed4a1cc24c3 (patch)
tree98895c303af1713597a4aae371e3683de0dedb2f /drivers
parent7529c0bec597d70bc61975a82063bb5112ac8879 (diff)
downloadredot-engine-c1b34672f95d03be104828679f606ed4a1cc24c3.tar.gz
[Windows] Enable crash reporter on MinGW builds, use libbacktrace to generate stack trace from DWARF symbols.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/SCsub2
-rw-r--r--drivers/backtrace/SCsub44
2 files changed, 46 insertions, 0 deletions
diff --git a/drivers/SCsub b/drivers/SCsub
index 9c8b16d3e5..e77b96cc87 100644
--- a/drivers/SCsub
+++ b/drivers/SCsub
@@ -14,6 +14,8 @@ SConscript("coreaudio/SCsub")
SConscript("pulseaudio/SCsub")
if env["platform"] == "windows":
SConscript("wasapi/SCsub")
+ if not env.msvc:
+ SConscript("backtrace/SCsub")
if env["xaudio2"]:
SConscript("xaudio2/SCsub")
diff --git a/drivers/backtrace/SCsub b/drivers/backtrace/SCsub
new file mode 100644
index 0000000000..f61fb21581
--- /dev/null
+++ b/drivers/backtrace/SCsub
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+
+Import("env")
+
+env_backtrace = env.Clone()
+
+# Thirdparty source files
+
+thirdparty_obj = []
+
+thirdparty_dir = "#thirdparty/libbacktrace/"
+thirdparty_sources = [
+ "atomic.c",
+ "dwarf.c",
+ "fileline.c",
+ "posix.c",
+ "print.c",
+ "sort.c",
+ "state.c",
+ "backtrace.c",
+ "simple.c",
+ "pecoff.c",
+ "read.c",
+ "alloc.c",
+]
+thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+
+env_backtrace.Prepend(CPPPATH=[thirdparty_dir])
+
+env_thirdparty = env_backtrace.Clone()
+env_thirdparty.disable_warnings()
+env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
+
+env.drivers_sources += thirdparty_obj
+
+# Godot source files
+
+driver_obj = []
+
+env_backtrace.add_source_files(driver_obj, "*.cpp")
+env.drivers_sources += driver_obj
+
+# Needed to force rebuilding the driver files when the thirdparty library is updated.
+env.Depends(driver_obj, thirdparty_obj)