diff options
| author | hachem <im@hachem.wtf> | 2026-09-06 06:21:52 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-06 06:21:52 +0200 |
| commit | 392c49d61fec199605c9cff6e1e2975660e1b846 (patch) | |
| tree | ab77f5deee5aa993b9bc9224904845af3107203c /tools/copy_files.py | |
| parent | 9a3a74070be2de9cd58f778e7a6d1df05cb60474 (diff) | |
feat: migrate over to meson
Diffstat (limited to 'tools/copy_files.py')
| -rw-r--r-- | tools/copy_files.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/copy_files.py b/tools/copy_files.py new file mode 100644 index 0000000..8ea67a9 --- /dev/null +++ b/tools/copy_files.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +# copy_files.py STAMP DEST SRC [SRC ...] +# +# Copy each SRC next to the built executable (DEST) and touch STAMP so Meson can +# track the custom_target. Used to stage the LLDB/Python runtime DLLs beside +# hsdbg.exe on Windows, mirroring the old premake postbuild copies. + +import os +import shutil +import sys + + +def main(argv): + if len(argv) < 3: + sys.stderr.write("usage: copy_files.py STAMP DEST SRC [SRC ...]\n") + return 1 + + stamp, dest = argv[1], argv[2] + os.makedirs(dest, exist_ok=True) + + for src in argv[3:]: + if os.path.isfile(src): + shutil.copy2(src, dest) + else: + sys.stderr.write(f"warning: {src} not found, skipping\n") + + with open(stamp, "w") as handle: + handle.write("") + + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) |
