# HG changeset patch # User Emmanuel Gil Peyrot # Date 1399806979 -7200 # Node ID a09f6990eab4b7b00173de8cf448a43e424871a5 # Parent 8895ede4e51e61454533727ba3ad4052e20830e9 Add a hack to prevent `setup.py clean` from compiling Cython files. diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -28,6 +28,18 @@ anmviewer = False # It’s currently broken anyway. use_opengl = True # Compile the OpenGL backend if True nthreads = 4 # How many processes to use for Cython compilation. + +# Hack to prevent `setup.py clean` from compiling Cython files. +if sys.argv[1] == 'clean': + import shutil + shutil.rmtree('build', ignore_errors=True) + for directory, _, files in os.walk('pytouhou'): + for filename in files: + if filename.endswith('.c'): + os.unlink(os.path.join(directory, filename)) + sys.exit(0) + + default_libs = { 'sdl2': '-lSDL2', 'SDL2_image': '-lSDL2_image',