From 06f22831804128bf33b16851eb5b9f8aa049748f Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sun, 7 Jan 2024 16:09:04 +0100 Subject: [PATCH] port: use cv2pdb on windows executables if present --- Makefile.port | 10 ++++++++++ port/src/crash.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.port b/Makefile.port index 0a53f3d33..e7a266855 100644 --- a/Makefile.port +++ b/Makefile.port @@ -154,6 +154,13 @@ ifneq (,$(findstring windows,$(TARGET_PLATFORM))) TARGET_LDFLAGS := $(shell pkg-config sdl2 --libs) -lz -lopengl32 -static-libstdc++ -ldbghelp # on windows/mingw we need this to be built with a 32-bit compiler so it finds the correct libs TOOLCHAIN ?= i686-w64-mingw32- + # check if cv2pdb is present + ifeq ($(CV2PDB),) + CV2PDB := cv2pdb + ifeq (,$(shell which cv2pdb 2>/dev/null)) + CV2PDB := + endif + endif else # assume *nix TARGET_CFLAGS := $(shell pkg-config sdl2 --cflags-only-I) TARGET_LDFLAGS := $(shell pkg-config sdl2 --libs) -lGL -lz -ldl @@ -305,6 +312,9 @@ $(G_DIR)/tiles/%.h: $(A_DIR)/tiles/%.json $(BIN): $(O_FILES) $(LD) $(COMMON_CFLAGS) $(OPT_LVL) -o $(BIN) $^ $(LDFLAGS) +ifneq ($(CV2PDB),) + $(CV2PDB) $(BIN) +endif $(B_DIR)/%.o: %.c @mkdir -p $(dir $@) diff --git a/port/src/crash.c b/port/src/crash.c index 1ea2ea557..47c24101b 100644 --- a/port/src/crash.c +++ b/port/src/crash.c @@ -10,7 +10,7 @@ #include "system.h" #include "platform.h" -#define CRASH_MAX_MSG 4096 +#define CRASH_MAX_MSG 8192 #define CRASH_MAX_SYM 256 #define CRASH_MAX_FRAMES 32 #define CRASH_MSG(...) \