Use LLDB_SRC for relative paths

Summary:
Going from LLDB_SRC instead of the file path is safer when looking for compiler-rt. Also need to add support for looking inside the LLVM runtimes subdirectory.

Eventually we should just get CMake to provide these paths during configuration.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25489

llvm-svn: 284045
This commit is contained in:
Chris Bieneman 2016-10-12 20:24:42 +00:00
parent 6cac34fd41
commit 47df0196b8
1 changed files with 10 additions and 2 deletions

View File

@ -649,14 +649,22 @@ def skipUnlessCompilerRt(func):
"""Decorate the item to skip tests if testing remotely."""
def is_compiler_rt_missing():
compilerRtPath = os.path.join(
os.path.dirname(__file__),
"..",
os.environ["LLDB_SRC"],
"..",
"..",
"..",
"llvm",
"projects",
"compiler-rt")
if not os.path.exists(compilerRtPath):
compilerRtPath = os.path.join(
os.environ["LLDB_SRC"],
"..",
"..",
"..",
"llvm",
"runtimes",
"compiler-rt")
return "compiler-rt not found" if not os.path.exists(
compilerRtPath) else None
return skipTestIfFn(is_compiler_rt_missing)(func)