🔨 Fix Warnings.cpp force-recompile

This commit is contained in:
Scott Lahteine 2022-07-14 21:03:11 -05:00
parent 653f0ab9dd
commit a50bb96d2d

View file

@ -79,22 +79,26 @@ if pioutil.is_pio_build():
raise SystemExit(err) raise SystemExit(err)
# #
# Give warnings on every build # Find the name.cpp.o or name.o and remove it
# #
def rm_ofile(subdir, name):
build_dir = os.path.join(env['PROJECT_BUILD_DIR'], build_env); build_dir = os.path.join(env['PROJECT_BUILD_DIR'], build_env);
for outdir in [ build_dir, os.path.join(build_dir, "debug") ]: for outdir in [ build_dir, os.path.join(build_dir, "debug") ]:
for wext in [ ".cpp", "" ]: for ext in [ ".cpp.o", ".o" ]:
warnfile = os.path.join(outdir, "src", "src", "inc", "Warnings" + wext + ".o") fpath = os.path.join(outdir, "src", "src", subdir, name + ext)
if os.path.exists(warnfile): if os.path.exists(fpath):
os.remove(warnfile) os.remove(fpath)
#
# Give warnings on every build
#
rm_ofile("inc", "Warnings")
# #
# Rebuild 'settings.cpp' for EEPROM_INIT_NOW # Rebuild 'settings.cpp' for EEPROM_INIT_NOW
# #
if 'EEPROM_INIT_NOW' in env['MARLIN_FEATURES']: if 'EEPROM_INIT_NOW' in env['MARLIN_FEATURES']:
setfile = os.path.join(srcpath, "module", "settings.cpp.o") rm_ofile("module", "settings")
if os.path.exists(setfile):
os.remove(setfile)
# #
# Check for old files indicating an entangled Marlin (mixing old and new code) # Check for old files indicating an entangled Marlin (mixing old and new code)