Skip to content

Commit 243af2f

Browse files
authored
[LLDB][test] Improve SHELL detection on Windows in Makefile.rules (llvm#99532)
In MinGW make, the `%windir%` variable has a lowercase name `$(windir)` when launched from cmd.exe, and `$(WINDIR)` name when launched from MSYS2, since MSYS2 represents standard Windows environment variables names in upper case. This commit makes Makefile.rules consider both run variants.
1 parent 42a7c42 commit 243af2f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
5555
# Also reset BUILDDIR value because "pwd" returns cygwin or msys path
5656
# which needs to be converted to windows path.
5757
#----------------------------------------------------------------------
58-
ifeq "$(OS)" "Windows_NT"
59-
SHELL = $(WINDIR)\system32\cmd.exe
58+
ifeq "$(HOST_OS)" "Windows_NT"
59+
# MinGW make gets $(windir) variable if launched from cmd.exe
60+
# and $(WINDIR) if launched from MSYS2.
61+
SHELL := $(or $(windir),$(WINDIR),C:\WINDOWS)\system32\cmd.exe
6062
BUILDDIR := $(shell echo %cd%)
6163
endif
6264

0 commit comments

Comments
 (0)