Files
micropython/examples/usercmodule/cppexample/micropython.mk
T
Dryw Wade 01df5a1f05 py/py.mk: Add LIBS_USERMOD to LIBS.
This enables C++ modules to correctly postion -l linker flags at the end of
the flags instead of at the start.  Updated the example C++ micropython.mk
accordingly.

Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2026-05-07 23:13:59 +10:00

16 lines
517 B
Makefile

CPPEXAMPLE_MOD_DIR := $(USERMOD_DIR)
# Add our source files to the respective variables.
SRC_USERMOD += $(CPPEXAMPLE_MOD_DIR)/examplemodule.c
SRC_USERMOD_CXX += $(CPPEXAMPLE_MOD_DIR)/example.cpp
# Add our module directory to the include path.
CFLAGS_USERMOD += -I$(CPPEXAMPLE_MOD_DIR)
CXXFLAGS_USERMOD += -I$(CPPEXAMPLE_MOD_DIR) -std=c++11
# Add any necessary paths to library files.
# LDFLAGS_USERMOD += -Lpath/to/libs
# We use C++ features so have to link against the standard library.
LIBS_USERMOD += -lstdc++