pass environment when invoking llvm-config and clang from lit.cfg

Use the same environment when invoking llvm-config from lit.cfg as
will be used when running tests, so that ASAN_OPTIONS, INCLUDE, etc.
are present.

llvm-svn: 218404
This commit is contained in:
Scott Douglass 2014-09-24 18:37:52 +00:00
parent ae671341c4
commit df914d55eb
1 changed files with 4 additions and 2 deletions

View File

@ -223,7 +223,8 @@ def getClangBuiltinIncludeDir(clang):
# FIXME: Rather than just getting the version, we should have clang print
# out its resource dir here in an easy to scrape form.
cmd = subprocess.Popen([clang, '-print-file-name=include'],
stdout=subprocess.PIPE)
stdout=subprocess.PIPE,
env=config.environment)
if not cmd.stdout:
lit_config.fatal("Couldn't find the include dir for Clang ('%s')" % clang)
dir = cmd.stdout.read().strip()
@ -423,7 +424,8 @@ def get_llvm_config_props():
'--assertion-mode',
'--targets-built',
],
stdout=subprocess.PIPE
stdout=subprocess.PIPE,
env=config.environment
)
# 1st line corresponds to --assertion-mode, "ON" or "OFF".
line = cmd.stdout.readline().strip().decode('ascii')