Make path more robust so it also works with out-of-tree builds.

llvm-svn: 347071
This commit is contained in:
Adrian Prantl 2018-11-16 18:43:16 +00:00
parent 3bb8c70dfa
commit c1e4f6a351
1 changed files with 3 additions and 1 deletions

View File

@ -128,8 +128,10 @@ llvm_config.feature_config(
# Clean the module caches in the test build directory. This is
# necessary in an incremental build whenever clang changes underneath,
# so doing it once per lit.py invocation is close enough.
for i in ['module-cache-clang', 'module-cache-lldb']:
cachedir = os.path.join(config.llvm_obj_root, 'lldb-test-build.noindex', i)
cachedir = os.path.join(config.lldb_libs_dir, '..',
'lldb-test-build.noindex', i)
if os.path.isdir(cachedir):
print("Deleting module cache at %s."%cachedir)
shutil.rmtree(cachedir)