-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsetup.py
More file actions
30 lines (25 loc) · 772 Bytes
/
setup.py
File metadata and controls
30 lines (25 loc) · 772 Bytes
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
from setuptools import Extension, setup
class get_pybind_include(object):
"""Helper class to determine the pybind11 include path
The purpose of this class is to postpone importing pybind11
until it is actually installed, so that the ``get_include()``
method can be invoked."""
def __str__(self):
try:
import pybind11
except ImportError:
return ""
return pybind11.get_include()
setup(
ext_modules=[
Extension(
"acbs.miniapt_query",
sorted(["src/miniapt-query.cc"]),
include_dirs=[str(get_pybind_include())],
extra_link_args=["-lapt-pkg"],
language="c++",
optional=True,
)
],
scripts=["acbs-build"]
)