diff options
author | stijn <stijn@ignitron.net> | 2020-10-08 16:44:55 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-10-29 15:29:20 +1100 |
commit | 0153148fd26308e4ce921a4287ac4a26af15a9fe (patch) | |
tree | 47d2af02d4fde79e07d0ec3b9e92a924531e1e03 /py | |
parent | 78c8b55067b2a3da8a2237fe8acd351d188902cb (diff) |
py/py.mk: Support C++ code for user C modules.
Support C++ code in .cpp files by providing CXX counterparts of the
_USERMOD_ flags we have for C already. This merely enables the Makefile of
user C modules to use variables specific to C++ compilation, it is still up
to each port's main Makefile to also include these in the build.
Diffstat (limited to 'py')
-rw-r--r-- | py/py.mk | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -33,7 +33,9 @@ ifneq ($(USER_C_MODULES),) # pre-define USERMOD variables as expanded so that variables are immediate # expanded as they're added to them SRC_USERMOD := +SRC_USERMOD_CXX := CFLAGS_USERMOD := +CXXFLAGS_USERMOD := LDFLAGS_USERMOD := $(foreach module, $(wildcard $(USER_C_MODULES)/*/micropython.mk), \ $(eval USERMOD_DIR = $(patsubst %/,%,$(dir $(module))))\ @@ -42,7 +44,9 @@ $(foreach module, $(wildcard $(USER_C_MODULES)/*/micropython.mk), \ ) SRC_MOD += $(patsubst $(USER_C_MODULES)/%.c,%.c,$(SRC_USERMOD)) +SRC_MOD_CXX += $(patsubst $(USER_C_MODULES)/%.cpp,%.cpp,$(SRC_USERMOD_CXX)) CFLAGS_MOD += $(CFLAGS_USERMOD) +CXXFLAGS_MOD += $(CXXFLAGS_USERMOD) LDFLAGS_MOD += $(LDFLAGS_USERMOD) endif |