Skip to content

Commit 2e64d34

Browse files
committed
Build on Windows.
1 parent 8ecd72f commit 2e64d34

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/build-natives.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,31 @@ permissions:
1313

1414
jobs:
1515
windows:
16-
name: Windows (x86 + x64)
17-
runs-on: ubuntu-22.04
16+
name: Windows (x64)
17+
runs-on: windows-2022
1818
steps:
1919
- name: Setup Dependencies
2020
run: |
21-
mkdir -p artifacts/x86
22-
mkdir artifacts/x64
23-
sudo apt-get install mingw-w64
21+
New-Item -ItemType Directory -Force artifacts/x64 | Out-Null
22+
23+
- name: Download sources
24+
shell: pwsh
25+
run: |
26+
$version = ${env:LUA_VERSION}
27+
$archive = "lua-${env:LUA_VERSION}.tar.gz"
28+
$url = "https://www.lua.org/ftp/$archive"
29+
Invoke-WebRequest -Uri $url -OutFile $archive
30+
tar xf $archive
2431
2532
- name: Compile natives
33+
shell: cmd
2634
run: |
27-
curl -s -L -O https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz
28-
tar xf lua-${LUA_VERSION}.tar.gz
29-
cd lua-${LUA_VERSION}/src/
30-
make mingw CC=i686-w64-mingw32-gcc
31-
cp lua51.dll ../../artifacts/x86/
32-
make clean
33-
make mingw CC=x86_64-w64-mingw32-gcc
35+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64 &
36+
cd lua-%LUA_VERSION%/src/
37+
cl /MD /O2 /c /DLUA_BUILD_AS_DLL *.c
38+
ren lua.obj lua.o
39+
ren luac.obj luac.o
40+
link /DLL /IMPLIB:lua51.lib /OUT:lua51.dll *.obj
3441
cp lua51.dll ../../artifacts/x64/
3542
3643
- name: Upload Artifacts

0 commit comments

Comments
 (0)