From 20cb7a904fc7db9aa07512a2304b1f9365d6518c Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 2 Apr 2020 22:22:54 -0400 Subject: [PATCH] This might actually fix the Windows bots after a16ba6fea. --- llvm/cmake/modules/AddLLVM.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 29eacf2..91bec7d 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -1455,9 +1455,18 @@ function(configure_lit_site_cfg site_in site_out) set(LIT_SITE_CFG_IN_HEADER "# Autogenerated from ${site_in}\n# Do not edit!") + # Lit converts config paths to lower case in discovery.py, before + # loading the config. This causes __file__ to be all lower-case (including + # the drive letter), but several clang tests pass -include %s and a + # clang warning checks that passed case matches on-disk cache. So it's + # important that this restores the on-disk case of the prefix. string(CONCAT LIT_SITE_CFG_IN_HEADER "${LIT_SITE_CFG_IN_HEADER}\n\n" "# Allow generated lit.site.cfg.py to be relocatable.\n" - "def path(p): return os.path.normpath(os.path.join(os.path.dirname(__file__), p)).replace(os.sep, '/') if p else ''\n" + "def path(p):\n" + " if not p: return ''\n" + " p = os.path.normpath(os.path.join(os.path.dirname(__file__), p)).replace(os.sep, '/')\n" + " if os.name == 'nt' and os.path.isabs(p): return p[0].upper() + p[1:]\n" + " return p\n" ) # Override config_target_triple (and the env) -- 2.7.4