diff options
author | Sean Callanan <scallanan@apple.com> | 2017-07-31 21:50:00 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2017-07-31 21:50:00 +0000 |
commit | 558e52c1089519bc8a4188b806717cf1bfd13d24 (patch) | |
tree | 184effb3e9436d03499104751df6f768aebd9906 /lldb/scripts/Xcode/build-llvm.py | |
parent | 038e28a5a71b63c145e6587eac3bfbf2a7ea1f44 (diff) | |
download | bcm5719-llvm-558e52c1089519bc8a4188b806717cf1bfd13d24.tar.gz bcm5719-llvm-558e52c1089519bc8a4188b806717cf1bfd13d24.zip |
[build-script] Bring in modernizations from downstream:
- Don't do any checks of the current SCM repository if the
llvm repositories are already there. Useful for bots.
- When symlinking, remove old symlinks.
- Support loading build-script as a library, not necessarily
under Xcode.
- Stringify args before passing them to subprocess.
llvm-svn: 309631
Diffstat (limited to 'lldb/scripts/Xcode/build-llvm.py')
-rwxr-xr-x | lldb/scripts/Xcode/build-llvm.py | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/lldb/scripts/Xcode/build-llvm.py b/lldb/scripts/Xcode/build-llvm.py index e2a46de1a16..4a18abefc85 100755 --- a/lldb/scripts/Xcode/build-llvm.py +++ b/lldb/scripts/Xcode/build-llvm.py @@ -14,7 +14,6 @@ from lldbbuild import * #### SETTINGS #### - def LLVM_HASH_INCLUDES_DIFFS(): return False @@ -42,7 +41,25 @@ def process_repo(r): 'ref': r["ref"] } +def fallback_repo(name): + return { + 'name': name, + 'vcs': None, + 'root': process_root(name), + 'url': None, + 'ref': None + } + +def dirs_exist(names): + for name in names: + if not os.path.isdir(process_root(name)): + return False + return True + def XCODE_REPOSITORIES(): + names = ["llvm", "clang", "ninja"] + if dirs_exist(names): + return [fallback_repo(n) for n in names] override = repo.get_override() if override: return [process_repo(r) for r in override] @@ -233,6 +250,8 @@ def should_build_llvm(): def do_symlink(source_path, link_path): print "Symlinking " + source_path + " to " + link_path + if os.path.islink(link_path): + os.remove(link_path) if not os.path.exists(link_path): os.symlink(source_path, link_path) @@ -433,8 +452,8 @@ def build_llvm_if_needed(): #### MAIN LOGIC #### -all_check_out_if_needed() -build_llvm_if_needed() -write_archives_txt() - -sys.exit(0) +if __name__ == "__main__": + all_check_out_if_needed() + build_llvm_if_needed() + write_archives_txt() + sys.exit(0) |