Skip to content

Instantly share code, notes, and snippets.

@bdbaddog
Created September 27, 2020 22:55
Show Gist options
  • Save bdbaddog/949eaa3c566cdb5a4d8c0fcb5e96b5e5 to your computer and use it in GitHub Desktop.
Save bdbaddog/949eaa3c566cdb5a4d8c0fcb5e96b5e5 to your computer and use it in GitHub Desktop.
User Damian's example
import os
dbgfilelist = [
'concrt140d.dll',
'msvcp140d.dll',
'vccorlib140d.dll',
'vcomp140.dll',
'vcruntime140d.dll'
]
relfilelist = [
'concrt140.dll',
'msvcp140.dll',
'vccorlib140.dll',
'vcomp140.dll',
'vcruntime140.dll'
]
# Now create dummy files
os.makedirs("bin", exist_ok=True)
for f in dbgfilelist+relfilelist:
with open("bin/%s" % f, 'w') as of:
of.write(f)
vars = Variables()
vars.AddVariables(EnumVariable('BUILDTYPE', help="Build type DEBUG or RELEASE",
default='RELEASE', allowed_values=("RELEASE", "DEBUG")))
thisenv = Environment(tools=[], variables=vars,
INSTALLDIR="#/Install", BINDIR="#/bin")
thisenv['INSTALLDIR'] = '$BINDIR/../interfaces/binaries/x64'
if thisenv['BUILDTYPE'] == 'DEBUG':
for cn in relfilelist:
thisenv.Execute(Delete(thisenv.File('$INSTALLDIR/%s'%cn)))
rel_install =thisenv.Install(thisenv['INSTALLDIR'], ['$BINDIR/%s'%x for x in dbgfilelist])
Default(rel_install)
else:
for cn in dbgfilelist:
thisenv.Execute(Delete(thisenv.File('$INSTALLDIR/%s'%cn)))
dbg_install = thisenv.Install(thisenv['INSTALLDIR'], ['$BINDIR/%s'%x for x in relfilelist])
Default(dbg_install)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment