-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
executable file
·81 lines (70 loc) · 2.38 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import distutils.sysconfig
import inspect
import os
import platform
# from distutils.core import Extension
from setuptools import Extension, setup
here = os.path.abspath(os.path.dirname(inspect.getsource(lambda: 0)))
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
# Work around the problem with the warning about '-Wstrict-prototypes'.
# https://bugs.python.org/issue1222585
config_vars = distutils.sysconfig.get_config_vars()
opt_to_remove = '-Wstrict-prototypes'
for var in ['OPT']:
if var in config_vars:
opts = config_vars[var].split()
if opt_to_remove in opts:
opts.remove(opt_to_remove)
config_vars[var] = ' '.join(opts)
cxx_flags = []
if platform.system() == 'Windows':
pass
else:
cxx_flags.extend([
'-std=c++11', '-Wall', '-fno-exceptions', '-fno-rtti',
'-O3',
# '-S', '-fverbose-asm', # TODO
])
z80_emulator_module = Extension(
name='z80._z80',
extra_compile_args=cxx_flags,
sources=['z80/_z80module.cpp'],
language='c++')
# TODO: Update the URL once we have a published documentation.
# TODO: Do we have a name for the emulator?
setup(name='z80',
version='1.0b2',
description='Fast and flexible Z80/i8080 Emulator',
long_description=long_description,
long_description_content_type='text/markdown',
author='Ivan Kosarev',
author_email='ivan@kosarev.info',
url='https://github.com/kosarev/z80',
license='MIT',
ext_modules=[z80_emulator_module],
packages=['z80'],
install_requires=[],
entry_points={
'console_scripts': [
'z80 = z80:main',
],
},
test_suite='tests.testsuite.suite',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: Education',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: C++',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Emulators',
],
)