Skip to content

Commit 42906ca

Browse files
committed
lit-tests: Forward env variables VSINSTALLDIR, PATH and LIB on Windows
In order not to fallback to the MinGW libs, which are most likely not available at testing time. Use the MSVC toolchain used for building instead, by forwarding the minimum set of required variables. This also greatly reduces the overall runtime of these tests, as the VS installation isn't auto-detected (incl. env variables setup) for every single linking operation.
1 parent 391abd3 commit 42906ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/lit.site.cfg.in

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ env_cxx = os.environ.get('CXX', '')
6363
if env_cxx:
6464
config.environment['CXX'] = env_cxx
6565

66+
if (platform.system() == 'Windows'):
67+
config.environment['VSINSTALLDIR'] = os.environ['VSINSTALLDIR']
68+
config.environment['PATH'] = os.environ['PATH']
69+
config.environment['LIB'] = os.environ['LIB']
70+
6671
# Define available features so that we can disable tests depending on LLVM version
6772
config.available_features.add("llvm%d" % config.llvm_version)
6873
# LLVM version history: 3.9, 4.0, 5.0, ...

0 commit comments

Comments
 (0)