-
Notifications
You must be signed in to change notification settings - Fork 24
/
setup.py
executable file
·37 lines (31 loc) · 951 Bytes
/
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
#!/usr/bin/env python
import sys
import os
from setuptools import setup, Extension
BUILD_EXTENSION = bool(os.environ.get("BUILD_EXTENSION", False)) or "build_ext" in sys.argv
# reflmodule extension
def reflmodule_config():
S = (
"reflmodule.cc",
"methods.cc",
"reflectivity.cc",
"magnetic.cc",
"contract_profile.cc",
"convolve.cc",
"convolve_sampled.cc",
"build_profile.cc",
)
Sdeps = ("erf.cc", "methods.h", "rebin.h", "rebin2D.h", "reflcalc.h")
sources = [os.path.join("refl1d", "lib", "c", f) for f in S]
depends = [os.path.join("refl1d", "lib", "c", f) for f in Sdeps]
return Extension(
"refl1d.reflmodule",
sources=sources,
depends=depends,
language="c++",
)
dist = setup(
data_files=[("share/icons", ["extra/refl1d-icon.svg"])],
ext_modules=[reflmodule_config()] if BUILD_EXTENSION else [],
)
# End of file