Skip to content

Commit 1606607

Browse files
committed
modure: Make sure that re1.5 compiled in only of modure itself is enabled.
This is achieved by including re1.5 *.c files straight from modure.c .
1 parent 457c0a6 commit 1606607

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

extmod/modure.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,12 @@ const mp_obj_module_t mp_module_ure = {
238238
.globals = (mp_obj_dict_t*)&mp_module_re_globals,
239239
};
240240

241+
// Source files #include'd here to make sure they're compiled in
242+
// only if module is enabled by config setting.
243+
244+
#define re1_5_fatal(x) assert(!x)
245+
#include "re1.5/compilecode.c"
246+
#include "re1.5/dumpcode.c"
247+
#include "re1.5/recursiveloop.c"
248+
241249
#endif //MICROPY_PY_URE

py/py.mk

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ PY_O_BASENAME = \
114114
../extmod/modzlibd.o \
115115
../extmod/modujson.o \
116116
../extmod/modure.o \
117-
../extmod/re1.5/compilecode.o \
118-
../extmod/re1.5/dumpcode.o \
119-
../extmod/re1.5/recursiveloop.o \
120117

121118
# prepend the build destination prefix to the py object files
122119
PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
@@ -169,7 +166,3 @@ $(PY_BUILD)/gc.o: CFLAGS += $(CSUPEROPT)
169166

170167
# optimising vm for speed, adds only a small amount to code size but makes a huge difference to speed (20% faster)
171168
$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT)
172-
173-
# Additional options for 3rd-party libs
174-
175-
$(PY_BUILD)/../extmod/re1.5/recursiveloop.o: CFLAGS += "-Dre1_5_fatal(x)=assert(!x)"

0 commit comments

Comments
 (0)