Skip to content

Commit d9d0458

Browse files
committed
Take the destination, create all includes.
1 parent d3ca799 commit d9d0458

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

install_headers.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import argparse
44
import pathlib
55
import shutil
6+
import sysconfig
67

78
from setuplib import gen
89

@@ -20,17 +21,20 @@ def main():
2021
gen + "/pygame_sdl2.display_api.h",
2122
]
2223

24+
targets = [
25+
pathlib.Path(args.target) / "include" / "pygame_sdl2",
26+
pathlib.Path(args.target) / "include" / ("python" + sysconfig.get_config_var("py_version_short")) / "pygame_sdl2",
27+
]
2328

29+
for target in targets:
2430

25-
headers_dir = pathlib.Path(args.target) / "pygame_sdl2"
31+
target.mkdir(exist_ok=True, parents=True)
2632

27-
headers_dir.mkdir(exist_ok=True)
33+
for header in headers:
34+
srcpath = pathlib.Path(header)
35+
dstpath = target / srcpath.name
2836

29-
for header in headers:
30-
srcpath = pathlib.Path(header)
31-
dstpath = headers_dir / srcpath.name
32-
33-
shutil.copy(srcpath, dstpath)
37+
shutil.copy(srcpath, dstpath)
3438

3539
if __name__ == "__main__":
3640
main()

0 commit comments

Comments
 (0)