diff options
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)) |
