diff options
Diffstat (limited to 'scripts/Xcode/build-llvm.py')
-rwxr-xr-x | scripts/Xcode/build-llvm.py | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/scripts/Xcode/build-llvm.py b/scripts/Xcode/build-llvm.py index e2a46de1a16ce..4d868de6b1099 100755 --- a/scripts/Xcode/build-llvm.py +++ b/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] @@ -207,7 +224,7 @@ def apply_patches(spec): f, spec['name'] + '.*.diff')] for p in patches: run_in_directory(["patch", - "-p0", + "-p1", "-i", os.path.join(lldb_source_path(), 'scripts', @@ -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) |