comparison setup.py @ 488:791faab05445

Don’t compile files that don’t benefit from static typing.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 04 Oct 2013 11:11:02 +0200
parents ec327e58b477
children bfea9e9a6845
comparison
equal deleted inserted replaced
487:711c75115675 488:791faab05445
35 35
36 36
37 for directory, _, files in os.walk('pytouhou'): 37 for directory, _, files in os.walk('pytouhou'):
38 package = directory.replace(os.path.sep, '.') 38 package = directory.replace(os.path.sep, '.')
39 packages.append(package) 39 packages.append(package)
40 if (package == 'pytouhou.formats' or package == 'pytouhou.vm'):
41 continue
42 if package == 'pytouhou.ui':
43 compile_args = get_arguments('--cflags', ['gl'] + SDL_LIBRARIES)
44 link_args = get_arguments('--libs', ['gl'] + SDL_LIBRARIES)
45 else:
46 compile_args = None
47 link_args = None
40 for filename in files: 48 for filename in files:
41 if filename.endswith('.pyx') or filename.endswith('.py') and not filename == '__init__.py': 49 if (filename.endswith('.pyx') or filename.endswith('.py') and
50 not filename == '__init__.py'):
42 extension_name = '%s.%s' % (package, os.path.splitext(filename)[0]) 51 extension_name = '%s.%s' % (package, os.path.splitext(filename)[0])
43 extension_names.append(extension_name) 52 extension_names.append(extension_name)
44 if extension_name == 'pytouhou.lib.sdl': 53 if extension_name == 'pytouhou.lib.sdl':
45 compile_args = get_arguments('--cflags', SDL_LIBRARIES) 54 compile_args = get_arguments('--cflags', SDL_LIBRARIES)
46 link_args = get_arguments('--libs', SDL_LIBRARIES) 55 link_args = get_arguments('--libs', SDL_LIBRARIES)
47 elif extension_name.startswith('pytouhou.ui.'): #XXX
48 compile_args = get_arguments('--cflags', ['gl'] + SDL_LIBRARIES)
49 link_args = get_arguments('--libs', ['gl'] + SDL_LIBRARIES)
50 else:
51 compile_args = None
52 link_args = None
53 extensions.append(Extension(extension_name, 56 extensions.append(Extension(extension_name,
54 [os.path.join(directory, filename)], 57 [os.path.join(directory, filename)],
55 extra_compile_args=compile_args, 58 extra_compile_args=compile_args,
56 extra_link_args=link_args)) 59 extra_link_args=link_args))
57 60