-
Notifications
You must be signed in to change notification settings - Fork 14
/
setup.py
59 lines (46 loc) · 1.66 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
import sys
import numpy as np
import setuptools
from setuptools import setup, find_packages
from setuptools.extension import Extension
from Cython.Distutils import build_ext
# Cython extension.
source_files = ['jpeg_ls/_CharLS.pyx',
'jpeg_ls/CharLS_src/interface.cpp',
'jpeg_ls/CharLS_src/jpegls.cpp',
'jpeg_ls/CharLS_src/header.cpp']
include_dirs = ['jpeg_ls/CharLS_src',
setuptools.distutils.sysconfig.get_python_inc(),
np.get_include()]
# Platform-specific arguments
if sys.platform == "win32":
extra_compile_args = [] # ['/EHsc']
extra_link_args = []
elif sys.platform == "darwin":
extra_compile_args = []
extra_link_args = []
else:
extra_compile_args = []
extra_link_args = []
# These next two lines are left over from when I was playing with MinGW64 on my Windows PC.
# extra_compile_args = ['-m64'] #, '-nostdlib', '-lgcc']
# extra_link_args = ['-m64'] #, '-nostdlib', '-lgcc']
ext = Extension('_CharLS', source_files,
language='c++',
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args)
# Do it.
version = '1.0.3'
setup(name='CharPyLS',
packages=find_packages(),
package_data={'': ['*.txt', '*.cpp', '*.h', '*.pyx']},
cmdclass={'build_ext': build_ext},
ext_modules=[ext],
# Metadata
version=version,
license='MIT',
author='Pierre V. Villeneuve',
author_email='[email protected]',
description='JPEG-LS for Python via CharLS C++ Library',
url='https://github.com/Who8MyLunch/CharPyLS')