try to set up clean action - does not work yet

This commit is contained in:
wellenvogel 2021-11-21 12:58:15 +01:00
parent 6e38a5250a
commit 1805f5578b
1 changed files with 13 additions and 0 deletions

View File

@ -192,4 +192,17 @@ def prebuild(env):
version="dev"+datetime.now().strftime("%Y%m%d")
env.Append(CPPDEFINES=[('GWDEVVERSION',version)])
def cleangenerated(source, target, env):
od=outPath()
if os.path.isdir(od):
print("#cleaning up %s"%od)
for f in os.listdir(od):
if f == "." or f == "..":
continue
fn=os.path.join(od,f)
os.unlink(f)
print("#prescript...")
prebuild(env)
#script does not run on clean yet - maybe in the future
env.AddPostAction("clean",cleangenerated)