Commit cea57980 authored by nanahira's avatar nanahira

add multi platform builds

parent eec77745
Pipeline #34102 passed with stages
in 2 minutes and 12 seconds
......@@ -4,6 +4,7 @@
/temp/
/premake-5/
/premake5.exe
/premake5
/dll.lua
/*.sh
......
stages:
- prepare
- build
- combine
- deploy
variables:
......@@ -18,7 +19,32 @@ lua:
paths:
- lua
.build:
mat_windows:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install wget tar patch p7zip-full
# premake5.exe
- wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-windows.zip
- 7z x -y premake-5.0.0-beta5-windows.zip
artifacts:
paths:
- premake5.exe
mat_macos:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install wget tar
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta5-macosx.tar.gz | tar zfx -
- chmod +x premake5
artifacts:
paths:
- premake5
.build_unix:
stage: build
tags:
- linux
......@@ -27,9 +53,10 @@ lua:
PREMAKE_OS: linux
BUILD_TYPE: x64
DIST_PATH: build/bin/x64/Release
PREMAKE5_PATH: premake5
script:
- ln -sf premake/dll.lua .
- premake5 gmake --file=dll.lua --os=$PREMAKE_OS
- $PREMAKE5_PATH gmake --file=dll.lua --os=$PREMAKE_OS
- cd build
- make config=release_${BUILD_TYPE} -j$(nproc)
- cd ..
......@@ -39,11 +66,11 @@ lua:
paths:
- dist
build_x64:
extends: .build
build_linux_x64:
extends: .build_unix
build_x32:
extends: .build
build_linux_x32:
extends: .build_unix
variables:
BUILD_TYPE: x32
DIST_PATH: build/bin/x32/Release
......@@ -51,7 +78,7 @@ build_x32:
- apt update; apt -y install gcc-multilib g++-multilib
build_wasm:
extends: .build
extends: .build_unix
variables:
PREMAKE_OS: emscripten
BUILD_TYPE: wasm
......@@ -61,11 +88,80 @@ build_wasm:
- mkdir -p wasm
image: git-registry.moenext.com/mycard/docker-ygopro-builder:emscripten
.build_windows:
stage: build
dependencies:
- mat_windows
- lua
tags:
- vs
before_script:
- copy premake\dll.lua dll.lua
- '.\premake5.exe vs2019 --file=dll.lua'
- mkdir dist
artifacts:
paths:
- dist
build_windows_x32:
extends: .build_windows
script:
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\ocgcoredll.sln /t:Build /p:Configuration=Release /p:Platform=Win32'
- mkdir dist\x32
- copy build\bin\x32\Release\ocgcore.dll dist\x32\ocgcore.dll
build_windows_x64:
extends: .build_windows
script:
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\ocgcoredll.sln /t:Build /p:Configuration=Release /p:Platform=x64'
- mkdir dist\x64
- copy build\bin\x64\Release\ocgcore.dll dist\x64\ocgcore.dll
.build_macos_arch:
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
MAC_ARM: '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
- rm -rf dist/x64 dist/arm64
artifacts:
paths:
- dist
upload_to_minio:
stage: deploy
dependencies:
- build_x32
- build_x64
- build_linux_x32
- build_linux_x64
- build_windows_x32
- build_windows_x64
- build_macos
- build_wasm
tags:
- linux
......
newoption { trigger = "lua-dir", description = "", value = "PATH", default = "./lua" }
newoption { trigger = "wasm", description = "" }
newoption { trigger = "mac-arm", description = "" }
function GetParam(param)
return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_")))
......@@ -20,6 +21,12 @@ workspace "ocgcoredll"
if WASM then
toolset "emcc"
platforms { "wasm" }
elseif os.istarget("macosx") then
if GetParam("mac-arm") then
platforms { "arm64" }
else
platforms { "x64" }
end
else
platforms { "x32", "x64" }
end
......
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