forked from ialhashim/PyEXR
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.py
56 lines (48 loc) · 1.33 KB
/
build.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
import platform
from pybind11.setup_helpers import Pybind11Extension
from setuptools.command.build_ext import build_ext
sources = [
'PyEXR.cpp',
]
include_dirs = [
'./tinyexr/',
'./tinyexr/examples/common/',
]
extra_compile_args = []
extra_link_args = []
define_macros = [('TINYEXR_USE_STB_ZLIB', 1), ('TINYEXR_USE_MINIZ', 0)]
if platform.system() == 'Windows':
pass
elif platform.system() == 'Darwin':
extra_compile_args.extend([
'-std=c++14',
'-mmacosx-version-min=10.9',
])
extra_link_args.extend([
'-stdlib=libc++',
])
else:
extra_compile_args.extend([
'-std=c++14',
])
extra_link_args.extend([])
ext_modules = [
Pybind11Extension('tinyexr',
sources,
language='c++',
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=define_macros)
]
def build(setup_kwargs):
with open('README.md', 'r') as fh:
long_description = fh.read()
setup_kwargs.update({
'long_description': long_description,
'long_description_content_type': 'text/markdown',
'ext_modules': ext_modules,
'cmdclass': {
'build_ext': build_ext
},
})