Index: scripts/Xcode/build-llvm.py =================================================================== --- scripts/Xcode/build-llvm.py +++ scripts/Xcode/build-llvm.py @@ -2,6 +2,7 @@ import errno import hashlib +import fnmatch import os import platform import subprocess @@ -166,9 +167,16 @@ #### CHECKING OUT AND BUILDING LLVM #### +def apply_patches(spec): + files = os.listdir(os.path.join(lldb_source_path(), 'scripts')) + patches = [f for f in files if fnmatch.fnmatch(f, spec['name'] + '.*.diff')] + for p in patches: + run_in_directory(["patch", "-p0", "-i", os.path.join(lldb_source_path(), 'scripts', p)], spec['root']) + def check_out_if_needed(spec): if not os.path.isdir(spec['root']): vcs(spec).check_out() + apply_patches(spec) def all_check_out_if_needed (): map (check_out_if_needed, XCODE_REPOSITORIES())