-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsetup.py
40 lines (33 loc) · 1.01 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
from setuptools import setup, Extension
import os
import sys
kwargs = dict()
itt_lib_dir = os.environ.get("ITT_LIB_DIR", None)
if itt_lib_dir:
kwargs["library_dirs"] = [itt_lib_dir]
else:
itt_lib_dir = os.environ.get("ITT_LIBRARY_DIR", None)
if itt_lib_dir:
kwargs["library_dirs"] = [itt_lib_dir]
elif sys.platform == "linux":
import sysconfig
itt_lib_dir = os.path.join(sysconfig.get_path("stdlib"), "..")
itt_include_dir = os.environ.get("ITT_INCLUDE_DIR", None)
if itt_include_dir:
kwargs["include_dirs"] = [itt_include_dir]
if sys.platform == "linux":
kwargs["extra_objects"] = [os.path.join(itt_lib_dir, "libittnotify.a")]
else:
kwargs["libraries"] = ["libittnotify"]
extension = Extension(
"itt._itt",
sources = ["itt-src/itt-python.c"],
**kwargs
)
setup(name = 'itt',
version = '0.0.5',
description = 'ITT API bindings for Python',
ext_modules = [extension],
packages=["itt"],
package_data={"itt": ["tests/test_itt.py"]},
)