Skip to content

Commit 20cb7a9

Browse files
committed
This might actually fix the Windows bots after a16ba6f.
1 parent 627e01f commit 20cb7a9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,18 @@ function(configure_lit_site_cfg site_in site_out)
14551455

14561456
set(LIT_SITE_CFG_IN_HEADER "# Autogenerated from ${site_in}\n# Do not edit!")
14571457

1458+
# Lit converts config paths to lower case in discovery.py, before
1459+
# loading the config. This causes __file__ to be all lower-case (including
1460+
# the drive letter), but several clang tests pass -include %s and a
1461+
# clang warning checks that passed case matches on-disk cache. So it's
1462+
# important that this restores the on-disk case of the prefix.
14581463
string(CONCAT LIT_SITE_CFG_IN_HEADER "${LIT_SITE_CFG_IN_HEADER}\n\n"
14591464
"# Allow generated lit.site.cfg.py to be relocatable.\n"
1460-
"def path(p): return os.path.normpath(os.path.join(os.path.dirname(__file__), p)).replace(os.sep, '/') if p else ''\n"
1465+
"def path(p):\n"
1466+
" if not p: return ''\n"
1467+
" p = os.path.normpath(os.path.join(os.path.dirname(__file__), p)).replace(os.sep, '/')\n"
1468+
" if os.name == 'nt' and os.path.isabs(p): return p[0].upper() + p[1:]\n"
1469+
" return p\n"
14611470
)
14621471

14631472
# Override config_target_triple (and the env)

0 commit comments

Comments
 (0)