Skip to content

Commit

Permalink
Merge pull request #29 from erinmaus/27-add-apple-silicon-support
Browse files Browse the repository at this point in the history
[#27] Add support for building universal lua-https modules.
  • Loading branch information
slime73 authored Jan 21, 2024
2 parents 55fa64f + 5ae9e8d commit 221bb84
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,35 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Lua 5.1
uses: leafo/gh-actions[email protected]
- name: Download LuaJIT
uses: actions/checkout@v3
with:
luaVersion: "5.1.5"
repository: LuaJIT/LuaJIT
ref: v2.1
path: LuaJIT
- name: Compile universal LuaJIT
working-directory: ./LuaJIT
run: |
TARGET_FLAGS="-arch x86_64" make
cp ./src/libluajit.so ./src/libluajit_x64.dylib
cp ./src/luajit ./src/luajit_x64
make clean
TARGET_FLAGS="-arch arm64" make
cp ./src/libluajit.so ./src/libluajit_arm.dylib
cp ./src/luajit ./src/luajit_arm
lipo -create -output ./src/libluajit.dylib ./src/libluajit_x64.dylib ./src/libluajit_arm.dylib
lipo -create -output ./src/luajit ./src/luajit_x64 ./src/luajit_arm
- name: Configure
run: cmake -Bbuild -S. -G Xcode -DLUA_INCLUDE_DIR=$PWD/.lua/include -DLUA_LIBRARIES=$PWD/.lua/lib/liblua.a
run: cmake -Bbuild -S. -G Xcode -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DLUA_INCLUDE_DIR=$PWD/LuaJIT/src -DLUA_LIBRARIES=$PWD/LuaJIT/src/lua
- name: Build
working-directory: build
run: xcodebuild -configuration Release -scheme https
- name: Test
working-directory: ./build/src/Release
run: lua -l "https" ../../../example/test.lua
run: ../../../LuaJIT/src/luajit -l "https" ../../../example/test.lua
- name: Artifact
if: always()
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 221bb84

Please sign in to comment.