diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..c08764d7e
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "submodules/lua"]
+ path = submodules/lua
+ url = https://github.com/lua/lua.git
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 30324cf9b..2c6eda1c5 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -20,7 +20,7 @@ resources:
steps:
- checkout: git://NetHack/NetHack@NetHack-3.7 # $(Agent.BuildDirectory)\s\NetHack
-- checkout: luarepo # $(Agent.BuildDirectory)\s\lua
+ submodules: true
- task: DownloadSecureFile@1
name: storeKey
diff --git a/submodules/lua b/submodules/lua
new file mode 160000
index 000000000..e2ea3b31c
--- /dev/null
+++ b/submodules/lua
@@ -0,0 +1 @@
+Subproject commit e2ea3b31c94bb3e1da27c233661cb2a16699c685
diff --git a/win/win32/vs/NetHackW.vcxproj b/win/win32/vs/NetHackW.vcxproj
index 61026d3a0..e9b5d7dd5 100644
--- a/win/win32/vs/NetHackW.vcxproj
+++ b/win/win32/vs/NetHackW.vcxproj
@@ -53,6 +53,7 @@
true
true
+ true
false
diff --git a/win/win32/vs/dirs.props b/win/win32/vs/dirs.props
index 05b6543ac..ed8a7554f 100644
--- a/win/win32/vs/dirs.props
+++ b/win/win32/vs/dirs.props
@@ -10,7 +10,7 @@
$(RootDir)dat\
$(RootDir)doc\
$(RootDir)include\
- $(RootDir)lib\lua-$(LUA_VERSION)\src\
+ $(RootDir)submodules\lua\
$(RootDir)src\
$(RootDir)sys\
$(RootDir)util\
diff --git a/win/win32/vs/makedefs.vcxproj b/win/win32/vs/makedefs.vcxproj
index 190952a6a..f82bb2c9a 100644
--- a/win/win32/vs/makedefs.vcxproj
+++ b/win/win32/vs/makedefs.vcxproj
@@ -55,10 +55,10 @@
Outputs="$(IncDir)\nhlua.h">
-
+
-
-
+
+