-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_hook.py
More file actions
32 lines (28 loc) · 957 Bytes
/
build_hook.py
File metadata and controls
32 lines (28 loc) · 957 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
31
32
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
from setuptools import Extension
import os
import pybind11
class CustomBuildHook(BuildHookInterface):
def initialize(self, version, build_data):
ext_modules = [
Extension(
"acd.core._acd",
sources=[
"src/acd/core/bindings.cpp",
"src/acd/core/acd.cpp",
],
include_dirs=[
pybind11.get_include(),
"src/acd/core",
os.environ.get("EIGEN_DIR", "third_party/eigen-3.4.1"),
],
language="c++",
extra_compile_args=["-O3", "-std=c++17"],
)
]
# Build in-place using setuptools
from setuptools import setup
setup(
script_args=["build_ext", "--inplace"],
ext_modules=ext_modules,
)