py: Rework QSTR extraction to work in simple and obvious way.
When there're C files to be (re)compiled, they're all passed first to preprocessor. QSTR references are extracted from preprocessed output and split per original C file. Then all available qstr files (including those generated previously) are catenated together. Only if the resulting content has changed, the output file is written (causing almost global rebuild to pick up potentially renumbered qstr's). Otherwise, it's not updated to not cause spurious rebuilds. Related make rules are split to minimize amount of commands executed in the interim case (when some C files were updated, but no qstrs were changed).
This commit is contained in:
@@ -37,9 +37,11 @@
|
||||
|
||||
// first entry in enum will be MP_QSTR_NULL=0, which indicates invalid/no qstr
|
||||
enum {
|
||||
#ifndef __QSTR_EXTRACT
|
||||
#define QDEF(id, str) id,
|
||||
#include "genhdr/qstrdefs.generated.h"
|
||||
#undef QDEF
|
||||
#endif
|
||||
MP_QSTRnumber_of, // no underscore so it can't clash with any of the above
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user