Skip to content

Commit b0feb9c

Browse files
sfe-SparkFrodpgeorge
authored andcommitted
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 micropython#18292. Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
1 parent 0e3cc29 commit b0feb9c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ports/mimxrt/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,15 @@ CFLAGS += \
437437
-Wfloat-conversion \
438438
-Wno-error=unused-parameter
439439

440+
# Flags for optional C++ source code
441+
CXXFLAGS += $(filter-out -std=c99,$(CFLAGS))
442+
443+
# TODO make this common -- shouldn't be using these "private" vars from py.mk
444+
ifneq ($(SRC_CXX)$(SRC_USERMOD_CXX)$(SRC_USERMOD_LIB_CXX),)
445+
LIBSTDCPP_FILE_NAME = "$(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a)"
446+
LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME))"
447+
endif
448+
440449
# Configure respective board flash type
441450
# Add hal/flexspi_nor_flash.h or hal/flexspi_hyper_flash.h respectively
442451
CFLAGS += -DBOARD_FLASH_OPS_HEADER_H=\"hal/flexspi_$(subst qspi_,,$(FLEXSPI_FLASH_TYPE)).h\"

0 commit comments

Comments
 (0)