From ca20ad3cfd07e23042beea25b7a965136a4dfe6f Mon Sep 17 00:00:00 2001 From: Frederik Seiffert Date: Mon, 23 Oct 2023 06:11:04 +0200 Subject: [PATCH] Ensure -gcodeview on Windows MSVC --- common.make | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common.make b/common.make index 07830e28..ef88c404 100644 --- a/common.make +++ b/common.make @@ -745,7 +745,7 @@ ifeq ($(debug), yes) ADDITIONAL_FLAGS := $(filter-out -O%, $(ADDITIONAL_FLAGS)) # If OPTFLAG does not already include -g, add it here. ifneq ($(filter -g, $(OPTFLAG)), -g) - ADDITIONAL_FLAGS += -g + OPTFLAG += -g endif # Add standard debug compiler flags. ADDITIONAL_FLAGS += -DDEBUG -fno-omit-frame-pointer @@ -759,6 +759,16 @@ else INTERNAL_JAVACFLAGS += -O endif +# On Windows MSVC we also need -gcodeview to generate debug symbols, and since +# Autoconf does not add it we add it here. +ifeq ($(GNUSTEP_TARGET_OS), windows) + ifeq ($(filter -g, $(OPTFLAG)), -g) + ifneq ($(filter -gcodeview, $(OPTFLAG)), -gcodeview) + OPTFLAG += -gcodeview + endif + endif +endif + ifeq ($(warn), no) ADDITIONAL_FLAGS += -UGSWARN else