Skip to content

Commit 9434cab

Browse files
committed
fixes argument list too long error when building.
1 parent 2850bf5 commit 9434cab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

builder/esp32.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,18 @@ def update_mpconfigport():
12311231
write_file(MPCONFIGPORT_PATH, data)
12321232

12331233

1234+
def update_mkrules():
1235+
mkrules_path = 'lib/micropython/py/mkrules.cmake'
1236+
with open(mkrules_path, 'rb') as f:
1237+
data = f.read().decode('utf-8')
1238+
1239+
if 'REMOVE_DUPLICATES' not in data:
1240+
data = data.replace('add_custom_command(', 'list(REMOVE_DUPLICATES MICROPY_CPP_FLAGS)\n\nadd_custom_command(', 1)
1241+
1242+
with open(mkrules_path, 'wb') as f:
1243+
f.write(data.encode('utf-8'))
1244+
1245+
12341246
def update_main():
12351247
# data = read_file('esp32', MAIN_PATH)
12361248

@@ -1429,6 +1441,7 @@ def compile(*args): # NOQA
14291441
update_panic_handler()
14301442
update_mpconfigboard()
14311443
update_mpconfigport()
1444+
update_mkrules()
14321445

14331446
copy_micropy_updates('esp32')
14341447

0 commit comments

Comments
 (0)