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: stages:
- prepare - prepare
- build - build
- combine
- deploy - deploy
variables: variables:
...@@ -123,42 +122,16 @@ build_windows_x64: ...@@ -123,42 +122,16 @@ build_windows_x64:
- copy build\bin\x64\Release\ocgcore.dll dist\x64\ocgcore.dll - copy build\bin\x64\Release\ocgcore.dll dist\x64\ocgcore.dll
- copy build\bin\x64\Release\sqlite3.dll dist\x64\sqlite3.dll - copy build\bin\x64\Release\sqlite3.dll dist\x64\sqlite3.dll
.build_macos_arch: build_macos:
extends: .build_unix extends: .build_unix
tags: tags:
- macos - macos
variables: variables:
PREMAKE_OS: macosx PREMAKE_OS: macosx
PREMAKE5_PATH: ./premake5 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 BUILD_TYPE: arm64
DIST_PATH: build/bin/arm64/Release DIST_PATH: build/bin/arm64/Release
MAC_UNIVERSAL: '1'
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
upload_to_minio: upload_to_minio:
stage: deploy stage: deploy
...@@ -172,6 +145,7 @@ upload_to_minio: ...@@ -172,6 +145,7 @@ upload_to_minio:
tags: tags:
- linux - linux
script: script:
- mv dist/arm64 dist/macos
- aws s3 --endpoint=https://minio.moenext.com:9000 sync --delete dist/ s3://mycard/libocgcore-koishi - aws s3 --endpoint=https://minio.moenext.com:9000 sync --delete dist/ s3://mycard/libocgcore-koishi
only: only:
- master - master
newoption { trigger = "lua-dir", description = "", value = "PATH", default = "./lua" } newoption { trigger = "lua-dir", description = "", value = "PATH", default = "./lua" }
newoption { trigger = "wasm", description = "" } newoption { trigger = "wasm", description = "" }
newoption { trigger = "sqlite3-dir", description = "", value = "PATH" } newoption { trigger = "sqlite3-dir", description = "", value = "PATH" }
newoption { trigger = "mac-universal", description = "" }
function GetParam(param) function GetParam(param)
return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_"))) return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_")))
...@@ -12,6 +13,7 @@ if not os.isdir(LUA_DIR) then ...@@ -12,6 +13,7 @@ if not os.isdir(LUA_DIR) then
end end
WASM = GetParam("wasm") WASM = GetParam("wasm")
MAC_UNIVERSAL = GetParam("mac-universal")
SQLITE3_DIR=GetParam("sqlite3-dir") SQLITE3_DIR=GetParam("sqlite3-dir")
...@@ -71,6 +73,10 @@ workspace "ocgcoredll" ...@@ -71,6 +73,10 @@ workspace "ocgcoredll"
filter "system:macosx" filter "system:macosx"
defines { "LUA_USE_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" filter "system:linux"
defines { "LUA_USE_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