| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
|
|
| import glob |
| import os |
| import sys |
| import shutil |
|
|
| script_dir = os.path.abspath(os.path.dirname(__file__)) |
| emscripten_root = os.path.dirname(os.path.dirname(script_dir)) |
| default_llvm_dir = os.path.join(os.path.dirname(emscripten_root), 'llvm-project') |
| copy_dirs = [ |
| ('compiler-rt', 'compiler-rt'), |
| ('libcxx', 'libcxx'), |
| ('libcxxabi', 'libcxxabi'), |
| ('libunwind', 'libunwind'), |
| ('llvm-libc', 'libc'), |
| ] |
|
|
|
|
| def main(): |
| if len(sys.argv) > 1: |
| upstream_root = os.path.join(os.path.abspath(sys.argv[1])) |
| else: |
| upstream_root = default_llvm_dir |
| if not os.path.exists(upstream_root): |
| print(f'llvm tree not found: {upstream_root}') |
| return 1 |
|
|
| for _, upstream_name in copy_dirs: |
| assert os.path.exists(os.path.join(upstream_root, upstream_name)) |
|
|
| for local_name, upstream_name in copy_dirs: |
| local_dir = os.path.join(script_dir, local_name) |
| upstream_dir = os.path.join(upstream_root, upstream_name) |
| print(f'copying {local_dir} -> {upstream_dir}') |
| shutil.copytree(local_dir, upstream_dir, dirs_exist_ok=True) |
|
|
|
|
| if __name__ == '__main__': |
| main() |
|
|