Commit 3f3ec1cb authored by mercury233's avatar mercury233 Committed by GitHub

add premake files to build ocgcore.dll with lua static linked (#477)

parent d4e635f4
name: Automated Test Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install lua
run: |
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.4.6.tar.gz ; exit 0"
tar xzf lua-5.4.6.tar.gz
move lua-5.4.6 lua
- name: Premake
run: |
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-windows.zip ; exit 0"
7z x premake-5.0.0-beta2-windows.zip
move premake\lua.lua lua\premake5.lua
move premake\dll.lua dll.lua
.\premake5.exe vs2022 --file=dll.lua
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build
run: |
msbuild build\ocgcoredll.sln /t:Build /p:"Configuration=Release;Platform=Win32"
msbuild build\ocgcoredll.sln /t:Build /p:"Configuration=Release;Platform=x64"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
path: |
build\bin\x32\Release\ocgcore.dll
build\bin\x64\Release\ocgcore.dll
- name: GitHub Release
if: github.event_name == 'push'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
build/bin/x64/Release/ocgcore.dll
.vscode/ .vscode/
/premake5.exe
/build
/lua
newoption { trigger = "lua-dir", description = "", value = "PATH", default = "./lua" }
function GetParam(param)
return _OPTIONS[param] or os.getenv(string.upper(string.gsub(param,"-","_")))
end
LUA_DIR=GetParam("lua-dir")
if not os.isdir(LUA_DIR) then
LUA_DIR="../lua"
end
workspace "ocgcoredll"
location "build"
language "C++"
configurations { "Release", "Debug" }
platforms { "x32", "x64" }
filter "platforms:x32"
architecture "x32"
filter "platforms:x64"
architecture "x64"
filter "configurations:Release"
optimize "Speed"
filter "configurations:Debug"
symbols "On"
defines "_DEBUG"
filter "system:windows"
defines { "WIN32", "_WIN32" }
systemversion "latest"
startproject "ocgcore"
filter { "configurations:Release", "action:vs*" }
flags { "LinkTimeOptimization" }
staticruntime "On"
disablewarnings { "4267", "4334" }
filter "action:vs*"
buildoptions { "/utf-8" }
defines { "_CRT_SECURE_NO_WARNINGS" }
filter {}
include(LUA_DIR)
project "ocgcore"
kind "SharedLib"
files { "*.cpp", "*.h" }
links { "lua" }
includedirs { LUA_DIR .. "/src" }
project "lua"
kind "StaticLib"
files { "src/*.c", "src/*.h", "src/*.hpp" }
removefiles { "src/lua.c", "src/luac.c" }
filter "action:vs*"
buildoptions { "/TP" }
filter "not action:vs*"
buildoptions { "-x c++" }
filter "system:bsd"
defines { "LUA_USE_POSIX" }
filter "system:macosx"
defines { "LUA_USE_MACOSX" }
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