Skip to content

Commit

Permalink
🔨 Fix Warnings.cpp force-recompile
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jul 24, 2022
1 parent 653f0ab commit a50bb96
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions buildroot/share/PlatformIO/scripts/preflight-checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,27 @@ def sanity_check_target():
err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p
raise SystemExit(err)

#
# 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);
for outdir in [ build_dir, os.path.join(build_dir, "debug") ]:
for ext in [ ".cpp.o", ".o" ]:
fpath = os.path.join(outdir, "src", "src", subdir, name + ext)
if os.path.exists(fpath):
os.remove(fpath)

#
# Give warnings on every build
#
build_dir = os.path.join(env['PROJECT_BUILD_DIR'], build_env);
for outdir in [ build_dir, os.path.join(build_dir, "debug") ]:
for wext in [ ".cpp", "" ]:
warnfile = os.path.join(outdir, "src", "src", "inc", "Warnings" + wext + ".o")
if os.path.exists(warnfile):
os.remove(warnfile)
rm_ofile("inc", "Warnings")

#
# Rebuild 'settings.cpp' for EEPROM_INIT_NOW
#
if 'EEPROM_INIT_NOW' in env['MARLIN_FEATURES']:
setfile = os.path.join(srcpath, "module", "settings.cpp.o")
if os.path.exists(setfile):
os.remove(setfile)
rm_ofile("module", "settings")

#
# Check for old files indicating an entangled Marlin (mixing old and new code)
Expand Down

0 comments on commit a50bb96

Please sign in to comment.