From 57a35d7a70cc075d311d7053c8744729131820b6 Mon Sep 17 00:00:00 2001
From: Alan Green <alan.green@gmail.com>
Date: Mon, 31 Oct 2022 06:10:06 +1100
Subject: [PATCH] soc/software/demo/Makefile: define WITH_CXX

Defines WITH_CXX to the C compiler when including hello.cpp in the demo.
This fixes a bug wahere the the menu did not include the hellocpp item
even when --with-cpp was passed to demo.py

Signed-off-by: Alan Green <alan.green@gmail.com>
---
 litex/soc/software/demo/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/litex/soc/software/demo/Makefile b/litex/soc/software/demo/Makefile
index cb2d3e745..a30071a51 100644
--- a/litex/soc/software/demo/Makefile
+++ b/litex/soc/software/demo/Makefile
@@ -6,6 +6,7 @@ include $(SOC_DIRECTORY)/software/common.mak
 OBJECTS   = donut.o helloc.o crt0.o main.o
 ifdef WITH_CXX
 	OBJECTS += hellocpp.o
+	CFLAGS += -DWITH_CXX
 endif