[LLDB] Allow API tests to override -gdwarf on Windows
authorMuhammad Omair Javaid <omair.javaid@linaro.org>
Wed, 29 Jun 2022 09:24:26 +0000 (13:24 +0400)
committerMuhammad Omair Javaid <omair.javaid@linaro.org>
Wed, 29 Jun 2022 19:24:18 +0000 (23:24 +0400)
This patch fixes LLDB API tests MakeFile.rules to allow overriding of
debug symbol flags when compiling tests for Windows.
Previously windows tests were forced to emit only dwarf debug symbols
as majority of the tests rely on dwarf debug info. After this patch
any test can override debug symbol flag by setting DEBUG_INFO_FLAG
variable in its make file.

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

index 9023128..b065a43 100644 (file)
@@ -212,6 +212,12 @@ ifneq (,$(findstring clang,$(CC)))
    MODULE_DEBUG_INFO_FLAGS += -gmodules
 endif
 
+# If the OS is Windows, we need to pass -gdwarf to clang, otherwise it will build
+# with codeview by default but all the tests rely on dwarf.
+ifeq "$(OS)" "Windows_NT"
+       DEBUG_INFO_FLAG ?= -gdwarf
+endif
+
 DEBUG_INFO_FLAG ?= -g
 
 CFLAGS ?= $(DEBUG_INFO_FLAG) -O0
@@ -236,12 +242,6 @@ endif
 
 CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS)
 
-# If the OS is Windows, we need to pass -gdwarf to clang, otherwise it will build
-# with codeview by default but all the tests rely on dwarf.
-ifeq "$(OS)" "Windows_NT"
-       CFLAGS += -gdwarf
-endif
-
 # Use this one if you want to build one part of the result without debug information:
 ifeq "$(OS)" "Darwin"
        CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)"