mimxrt/Makefile: Add CXXFLAGS, and libstdc++ to LDFLAGS.

This allows user C modules to be built into the mimxrt port.  The change is
copied from `samd/Makefile`.

Fixes issue #18292.

Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
This commit is contained in:
Dryw Wade 2025-10-17 15:44:37 -06:00 committed by Damien George
parent 0e3cc2910d
commit b0feb9c7ee

View File

@ -437,6 +437,15 @@ CFLAGS += \
-Wfloat-conversion \
-Wno-error=unused-parameter
# Flags for optional C++ source code
CXXFLAGS += $(filter-out -std=c99,$(CFLAGS))
# TODO make this common -- shouldn't be using these "private" vars from py.mk
ifneq ($(SRC_CXX)$(SRC_USERMOD_CXX)$(SRC_USERMOD_LIB_CXX),)
LIBSTDCPP_FILE_NAME = "$(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a)"
LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME))"
endif
# Configure respective board flash type
# Add hal/flexspi_nor_flash.h or hal/flexspi_hyper_flash.h respectively
CFLAGS += -DBOARD_FLASH_OPS_HEADER_H=\"hal/flexspi_$(subst qspi_,,$(FLEXSPI_FLASH_TYPE)).h\"