Mercurial > touhou
comparison setup.py @ 542:a09f6990eab4
Add a hack to prevent `setup.py clean` from compiling Cython files.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 11 May 2014 13:16:19 +0200 |
parents | 8895ede4e51e |
children | 94dd9862c470 |
comparison
equal
deleted
inserted
replaced
541:8895ede4e51e | 542:a09f6990eab4 |
---|---|
25 | 25 |
26 debug = False # True to generate HTML annotations and display infered types. | 26 debug = False # True to generate HTML annotations and display infered types. |
27 anmviewer = False # It’s currently broken anyway. | 27 anmviewer = False # It’s currently broken anyway. |
28 use_opengl = True # Compile the OpenGL backend if True | 28 use_opengl = True # Compile the OpenGL backend if True |
29 nthreads = 4 # How many processes to use for Cython compilation. | 29 nthreads = 4 # How many processes to use for Cython compilation. |
30 | |
31 | |
32 # Hack to prevent `setup.py clean` from compiling Cython files. | |
33 if sys.argv[1] == 'clean': | |
34 import shutil | |
35 shutil.rmtree('build', ignore_errors=True) | |
36 for directory, _, files in os.walk('pytouhou'): | |
37 for filename in files: | |
38 if filename.endswith('.c'): | |
39 os.unlink(os.path.join(directory, filename)) | |
40 sys.exit(0) | |
41 | |
30 | 42 |
31 default_libs = { | 43 default_libs = { |
32 'sdl2': '-lSDL2', | 44 'sdl2': '-lSDL2', |
33 'SDL2_image': '-lSDL2_image', | 45 'SDL2_image': '-lSDL2_image', |
34 'SDL2_mixer': '-lSDL2_mixer', | 46 'SDL2_mixer': '-lSDL2_mixer', |