tools/makemanifest.py: Support freezing with empty list of mpy files.
Fixes issue #5655.
This commit is contained in:
parent
410757f4f4
commit
a636837987
@ -276,10 +276,22 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Freeze .mpy files
|
# Freeze .mpy files
|
||||||
res, output_mpy = system([sys.executable, MPY_TOOL, '-f', '-q', args.build_dir + '/genhdr/qstrdefs.preprocessed.h'] + mpy_files)
|
if mpy_files:
|
||||||
if res != 0:
|
res, output_mpy = system([sys.executable, MPY_TOOL, '-f', '-q', args.build_dir + '/genhdr/qstrdefs.preprocessed.h'] + mpy_files)
|
||||||
print('error freezing mpy {}: {}'.format(mpy_files, output_mpy))
|
if res != 0:
|
||||||
sys.exit(1)
|
print('error freezing mpy {}:'.format(mpy_files))
|
||||||
|
print(str(output_mpy, 'utf8'))
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
output_mpy = (
|
||||||
|
b'#include "py/emitglue.h"\n'
|
||||||
|
b'extern const qstr_pool_t mp_qstr_const_pool;\n'
|
||||||
|
b'const qstr_pool_t mp_qstr_frozen_const_pool = {\n'
|
||||||
|
b' (qstr_pool_t*)&mp_qstr_const_pool, MP_QSTRnumber_of, 0, 0\n'
|
||||||
|
b'};\n'
|
||||||
|
b'const char mp_frozen_mpy_names[1] = {"\\0"};\n'
|
||||||
|
b'const mp_raw_code_t *const mp_frozen_mpy_content[0] = {};\n'
|
||||||
|
)
|
||||||
|
|
||||||
# Generate output
|
# Generate output
|
||||||
print('GEN', args.output)
|
print('GEN', args.output)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user