Skip to content

Commit c353873

Browse files
committed
mimxrt/Makefile: Add CXXFLAGS, and libstdc++ to LDFLAGS.
Copied from samd/Makefile. Signed-off-by: Dryw Wade <[email protected]>
1 parent 9999553 commit c353873

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ports/mimxrt/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,15 @@ CFLAGS += \
430430
-Wfloat-conversion \
431431
-Wno-error=unused-parameter
432432

433+
# Flags for optional C++ source code
434+
CXXFLAGS += $(filter-out -std=c99,$(CFLAGS))
435+
436+
# TODO make this common -- shouldn't be using these "private" vars from py.mk
437+
ifneq ($(SRC_CXX)$(SRC_USERMOD_CXX)$(SRC_USERMOD_LIB_CXX),)
438+
LIBSTDCPP_FILE_NAME = "$(shell $(CXX) $(CXXFLAGS) -print-file-name=libstdc++.a)"
439+
LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME))"
440+
endif
441+
433442
# Configure respective board flash type
434443
# Add hal/flexspi_nor_flash.h or hal/flexspi_hyper_flash.h respectively
435444
CFLAGS += -DBOARD_FLASH_OPS_HEADER_H=\"hal/flexspi_$(subst qspi_,,$(FLEXSPI_FLASH_TYPE)).h\"

0 commit comments

Comments
 (0)