From c8499c89dbdfec0a50b90130e49ea77df4a3ee98 Mon Sep 17 00:00:00 2001 From: Ivo Popov Date: Wed, 10 Feb 2021 00:48:58 -0500 Subject: [PATCH] Set -DCMAKE_BUILD_TYPE=Debug when building in debug for rp2040. This ensures that the Pico SDK, too, is built in debug mode and with nice debugging symbols. --- examples/rules.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/rules.mk b/examples/rules.mk index 66194dfcc..d248ed247 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -45,6 +45,10 @@ $(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).bin else ifeq ($(FAMILY),rp2040) +ifeq ($(DEBUG), 1) +CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug +endif + $(BUILD): cmake -S . -B $(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) -DPICO_BUILD_DOCS=0 $(CMAKE_DEFSYM)