-
Download the latest LuaJIT sources
-
Create temporary folder for LuaJIT sources.
I assume you would useC:\Temp\
folder. -
Download and install Portable "Git for Windows"
-
Run
git-cmd.exe
, a console window will open. -
Execute the following commands in this console window:
cd /d C:\Temp\
git clone https://luajit.org/git/luajit.git
cd luajit
git checkout v2.1
-
Close the console window.
Now you have LuaJIT 2.1 sources in the folderC:\Temp\luajit\
-
You can uninstall "Git for Windows" application now.
It's portable, so just remove its folder.
-
-
Build LuaJIT binaries using MinGW64
-
Download and install MSYS2.
It is recommended to install MSYS2 in the default destination folderC:\msys64\
,
but you may choose another path consisting of English letters without spaces. -
After installation is complete, a MSYS2 console window will open.
Execute the following command in this MSYS2 console window:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
When askedProceed with installation? [Y/n]
, answerY
and pressEnter
. -
Close this MSYS2 console window and open a new one by clicking the
MSYS2 MinGW 64-bit
menu item in Windows Start menu.
Execute the following commands in the new MSYS2 window:
cd /c/Temp/luajit/
mingw32-make CFLAGS=-DLUAJIT_ENABLE_LUA52COMPAT
-
Close the MSYS2 console window.
-
You can uninstall MSYS2 application now at
Control Panel
->Programs and Features
.
-
-
Take LuaJIT binaries
-
Open folder
C:\Temp\luajit\src\
Sort files by "Date Modified". -
Find 2 files:
luajit.exe
andlua51.dll
among the most recently modified. -
Take these 2 files and put them to the folder where Lua binaries should be on your system.
-
You can remove LuaJIT sources now.
Delete folderC:\Temp\luajit\
-
Last active
July 26, 2022 22:11
-
-
Save Egor-Skriptunoff/30c9a12665d77e33e35499ff2664fcd5 to your computer and use it in GitHub Desktop.
How to build LuaJIT for Windows
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment