Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (56 loc) · 2.23 KB
/
Copy pathsetup.py
File metadata and controls
66 lines (56 loc) · 2.23 KB
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
57
58
59
60
61
62
63
64
65
66
import sys
from sysconfig import get_config_vars
if __name__ == "__main__" and len(sys.argv) == 1:
print(
"setup.py is used by the PEP 517 build backend.\n"
"Use `uv sync` to install the package, "
"`uv run python run_all_tests.py` to test it, or "
"`uv run python -m build` to build distributions.",
file=sys.stderr,
)
raise SystemExit(2)
from setuptools import Extension, setup
def _remove_strict_prototypes():
"""Remove a C-only compiler flag that Python can add for C++ builds."""
cfg_vars = get_config_vars()
for key, value in cfg_vars.items():
if isinstance(value, str):
cfg_vars[key] = value.replace("-Wstrict-prototypes", "")
def _compile_args():
args = ["-D_hypot=hypot"]
if sys.platform != "win32":
args.append("-std=c++11")
return args
_remove_strict_prototypes()
setup(
ext_modules=[
Extension(
"winnf.propag.itm.itm_its",
sources=[
"src/winnf/propag/itm/its/itm.cpp",
"src/winnf/propag/itm/itm_its_py.cpp",
],
include_dirs=["src/winnf/propag/itm/its"],
extra_compile_args=_compile_args(),
),
Extension(
"winnf.propag.ehata.ehata_its",
sources=[
"src/winnf/propag/ehata/its/ExtendedHata.cpp",
"src/winnf/propag/ehata/its/FindHorizons.cpp",
"src/winnf/propag/ehata/its/FindQuantile.cpp",
"src/winnf/propag/ehata/its/FineRollingHillyTerrainCorectionFactor.cpp",
"src/winnf/propag/ehata/its/GeneralSlopeCorrectionFactor.cpp",
"src/winnf/propag/ehata/its/IsolatedRidgeCorrectionFactor.cpp",
"src/winnf/propag/ehata/its/LeastSquares.cpp",
"src/winnf/propag/ehata/its/MedianBasicPropLoss.cpp",
"src/winnf/propag/ehata/its/MedianRollingHillyTerrainCorrectionFactor.cpp",
"src/winnf/propag/ehata/its/MixedPathCorrectionFactor.cpp",
"src/winnf/propag/ehata/its/PreprocessTerrainPath.cpp",
"src/winnf/propag/ehata/ehata_its_py.cpp",
],
include_dirs=["src/winnf/propag/ehata/its"],
extra_compile_args=_compile_args(),
),
]
)