Skip to content

Commit 9020961

Browse files
authored
Automate native source collection for setup script
Instead of manually declaring all native source files in the setup.py, the script searches all native sources files automatically.
1 parent 2774517 commit 9020961

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

setup.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22
from setuptools import setup, Extension
33
import platform
4+
import pathlib
45

56

67
def check_platform():
@@ -11,20 +12,7 @@ def check_platform():
1112

1213
check_platform()
1314

14-
sources = [
15-
"framebuffers.c",
16-
"module_pyfb.c",
17-
"color.c",
18-
"paint.c"
19-
]
20-
21-
# Add prefix
22-
src_prefix = "native/"
23-
src = []
24-
25-
for i in sources:
26-
src.append(src_prefix + i)
27-
15+
src = list(pathlib.Path('native').glob("*.c"))
2816

2917
setup(name="pyframebuffer",
3018
version="1.0",

0 commit comments

Comments
 (0)