Commit 6e2648e1 authored by nanahira's avatar nanahira

Update premake/dll.lua, .gitlab-ci.yml files

parent cd8598dd
Pipeline #35858 canceled with stages
in 2 minutes and 25 seconds
stages:
- prepare
- build
- combine
- deploy
variables:
......@@ -123,42 +122,16 @@ build_windows_x64:
- copy build\bin\x64\Release\ocgcore.dll dist\x64\ocgcore.dll
- copy build\bin\x64\Release\sqlite3.dll dist\x64\sqlite3.dll
.build_macos_arch:
build_macos:
extends: .build_unix
tags:
- macos
variables:
PREMAKE_OS: macosx
PREMAKE5_PATH: ./premake5
build_macos_x64:
extends: .build_macos_arch
variables:
BUILD_TYPE: x64
build_macos_m1:
extends: .build_macos_arch
tags:
- macos-m1
variables:
BUILD_TYPE: arm64
DIST_PATH: build/bin/arm64/Release
build_macos:
stage: combine
dependencies:
- build_macos_x64
- build_macos_m1
tags:
- macos
script:
- mkdir -p dist/macos
- lipo -create -output dist/macos/libocgcore.dylib dist/x64/libocgcore.dylib dist/arm64/libocgcore.dylib
- lipo -create -output dist/macos/libsqlite3.dylib dist/x64/libsqlite3.dylib dist/arm64/libsqlite3.dylib
- rm -rf dist/x64 dist/arm64
artifacts:
paths:
- dist
MAC_UNIVERSAL: '1'
upload_to_minio:
stage: deploy
......@@ -172,6 +145,7 @@ upload_to_minio:
tags:
- linux
script:
- mv dist/arm64 dist/macos
- aws s3 --endpoint=https://minio.moenext.com:9000 sync --delete dist/ s3://mycard/libocgcore-koishi
only:
- master
newoption { trigger = "lua-dir", description = "", value = "PATH", default = "./lua" }
newoption { trigger = "wasm", description = "" }
newoption { trigger = "sqlite3-dir", description = "", value = "PATH" }
newoption { trigger = "mac-universal", description = "" }
function GetParam(param)
return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_")))
......@@ -12,6 +13,7 @@ if not os.isdir(LUA_DIR) then
end
WASM = GetParam("wasm")
MAC_UNIVERSAL = GetParam("mac-universal")
SQLITE3_DIR=GetParam("sqlite3-dir")
......@@ -71,6 +73,10 @@ workspace "ocgcoredll"
filter "system:macosx"
defines { "LUA_USE_MACOSX" }
if MAC_UNIVERSAL then
buildoptions { "-arch x86_64", "-arch arm64" }
linkoptions { "-arch x86_64", "-arch arm64" }
end
filter "system:linux"
defines { "LUA_USE_LINUX" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment