Search code examples
pythonc++swigscons

scons - delete some of the built files after the compilation process


I have a scons setup where I can choose to run SWIG and build a python module from c++.

this creates files such as

  • x_wrap.cc
  • x.lib
  • x.obj

etc.

When all I want to have at the end of the process are theses files:

  • _x.pyd
  • x.py

Is there a way I can get scons to delete the unwanted files after the build process?


Solution

  • It seems like using the "Delete" function as a Command, after the SharedLibrary line, allows me to delete the unwanted files.