-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
30 lines (27 loc) · 851 Bytes
/
setup.py
File metadata and controls
30 lines (27 loc) · 851 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 setup, Extension
import platform
import os
import sys
compile_args = ["-std=c++17", "-O3", "-ffast-math"]
if platform.system() != "Windows":
archflags = os.environ.get("ARCHFLAGS", "")
if "x86_64" in archflags:
compile_args.append("-march=x86-64")
elif "arm64" in archflags:
compile_args.append("-mcpu=apple-m1")
elif platform.machine() == "x86_64":
compile_args.append("-march=x86-64")
elif platform.machine() == "aarch64" or platform.machine() == "arm64":
compile_args.append("-mcpu=native")
if sys.platform == "win32":
compile_args = ["/std:c++17", "/O2", "/fp:fast"]
setup(
ext_modules=[
Extension(
"kelzer",
sources=["cpp/kelzer.cpp"],
language="c++",
extra_compile_args=compile_args,
)
],
)