WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit bac9a29

Browse files
authored
Merge pull request #574 from red031000/master
wsl2 patch, closes #559
2 parents cd05541 + 725eb54 commit bac9a29

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Makefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ default: all
2626
# If you are using WSL, it is recommended you build with NOWINE=1.
2727
WSLENV ?= no
2828
ifeq ($(WSLENV),no)
29-
NOWINE = 0
29+
NOWINE = 0
3030
else
31-
NOWINE = 1
31+
# As of build 17063, WSLENV is defined in both WSL1 and WSL2
32+
# so we need to use the kernel release to detect between
33+
# the two.
34+
UNAME_R := $(shell uname -r)
35+
ifeq ($(findstring WSL2,$(UNAME_R)),)
36+
NOWINE = 1
37+
else
38+
NOWINE = 0
39+
endif
3240
endif
3341

3442
ifeq ($(OS),Windows_NT)
@@ -50,7 +58,10 @@ endif
5058
endif
5159

5260
ifeq ($(NOWINE),1)
53-
WINE :=
61+
WINE :=
62+
WINPATH := wslpath
63+
else
64+
WINPATH := winepath
5465
endif
5566

5667
################ Target Executable and Sources ###############

0 commit comments

Comments
 (0)