-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.py
More file actions
51 lines (47 loc) · 1.23 KB
/
Copy pathbuild.py
File metadata and controls
51 lines (47 loc) · 1.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
from setuptools import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import sys
import os
inc_dirs = []
lib_dirs = []
libs = ["SDL2"]
compile_args = []
if sys.platform == "win32":
inc_dirs = ["lib/win/cInc"]
lib_dirs = ["lib/win/cLibs"]
compile_args = ["/O2"]
elif sys.platform.startswith("linux"):
inc_dirs = ["/usr/include/SDL2"]
compile_args = ["-O3"]
elif sys.platform == "darwin":
inc_dirs = ["/opt/homebrew/include/SDL2", "/usr/local/include/SDL2"]
lib_dirs = ["/opt/homebrew/lib", "/usr/local/lib"]
compile_args = ["-O3"]
ext = [
Extension(
"vorx.objects.shapes",
["vorx/objects/shapes.pyx"],
extra_compile_args=compile_args,
),
Extension(
"vorx.core.maths.vectors",
["vorx/core/maths/vectors.pyx"],
extra_compile_args=compile_args,
),
Extension(
"vorx.core.renderer",
["vorx/core/renderer.pyx"],
include_dirs=inc_dirs,
library_dirs=lib_dirs,
libraries=libs,
extra_compile_args=compile_args,
),
]
setup(
ext_modules=cythonize(
ext,
build_dir="compiled",
),
script_args=["build_ext", "--build-lib", os.path.abspath("compiled")],
)