File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff 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 \n add_custom_command(' , 1 )
1241+
1242+ with open (mkrules_path , 'wb' ) as f :
1243+ f .write (data .encode ('utf-8' ))
1244+
1245+
12341246def 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
You can’t perform that action at this time.
0 commit comments