Commit ba5a207a authored by nanahira's avatar nanahira

Merge branch 'develop-static-build' into develop

parents 534cb075 9cd5900a
Pipeline #36835 canceled with stages
in 2 minutes and 55 seconds
#!/bin/sh
set -x
set -o errexit
if [ -n "$NO_AUDIO" ]; then
echo "Skipping opus build because NO_AUDIO is set"
exit 0
fi
cd miniaudio
external_built_dir="$PWD/external-built"
is_macos=false
if [ "$(uname)" = "Darwin" ]; then
is_macos=true
fi
maybe_patch_configure() {
if $is_macos; then
sed -i.bak 's/-force_cpusubtype_ALL//g' configure*
fi
}
build_single_thing() {
lib_name="$1"
cd "external/$lib_name"
shift
maybe_patch_configure
PKG_CONFIG_PATH="$external_built_dir/lib/pkgconfig" CFLAGS="$OPUS_FLAGS" CXXFLAGS="$OPUS_FLAGS" ./configure --prefix="$external_built_dir" --enable-static=yes --enable-shared=no "$@"
make -j$(nproc)
make install
cd ../..
}
build_single_thing ogg
build_single_thing opus
build_single_thing opusfile --disable-examples --disable-http
build_single_thing vorbis --with-ogg="$external_built_dir"
cd ..
#!/bin/bash
libs_to_configure=(
"ogg"
# "opus"
)
cd miniaudio/external
for lib in "${libs_to_configure[@]}"; do
cd $lib
./configure
cd ..
done
#!/bin/sh
set -x
set -o errexit
cd event
./configure --disable-openssl --enable-static=yes --enable-shared=no
sed -f make-event-config.sed < config.h > ./include/event2/event-config.h
cd ..
......@@ -4,23 +4,13 @@ set -o errexit
TARGET_PLATFORM=$(arch)
TARGET_YGOPRO_BINARY_PATH=./ygopro-platforms/ygopro-platform-$TARGET_PLATFORM
export EVENT_INCLUDE_DIR=$PWD/libevent-stable/include
export EVENT_LIB_DIR=$PWD/libevent-stable/lib
export OPUS_INCLUDE_DIR=$PWD/miniaudio/external-built/include/opus
export OPUS_LIB_DIR=$PWD/miniaudio/external-built/lib
export OPUSFILE_INCLUDE_DIR=$PWD/miniaudio/external-built/include/opus
export OPUSFILE_LIB_DIR=$PWD/miniaudio/external-built/lib
export VORBIS_INCLUDE_DIR=$PWD/miniaudio/external-built/include
export VORBIS_LIB_DIR=$PWD/miniaudio/external-built/lib
export OGG_INCLUDE_DIR=$PWD/miniaudio/external-built/include
export OGG_LIB_DIR=$PWD/miniaudio/external-built/lib
export ACLOCAL=aclocal
export AUTOMAKE=automake
./.ci/libevent-prebuild.sh
./.ci/build-opus.sh
./premake5 gmake --cc=clang --build-freetype --build-sqlite
./.ci/configure-libevent.sh
./.ci/configure-audio.sh
rm -rf sqlite3/VERSION sqlite3/version
./premake5 gmake --cc=clang
cd build
make config=release -j$(sysctl -n hw.ncpu)
......
#!/bin/sh
set -x
set -o errexit
# PROCESSOR_COUNT=4
if [ -d "libevent-stable" ]; then
rm -rf libevent-stable
fi
if [ ! -d "libevent-2.0.22-stable" ]; then
wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
fi
install_path="$PWD/libevent-stable"
cd libevent-2.0.22-stable
./configure "--prefix=$install_path" --disable-openssl --enable-static=yes --enable-shared=no "$@"
make -j$(nproc)
make install
cd ..
......@@ -11,8 +11,41 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
audiolib: [miniaudio, irrklang]
name:
- windows
- windows-xp
- windows-irrklang
- windows-no-dxsdk
- windows-x64
# - windows-2025
include:
- name: windows
os: windows-2022
vs: vs2022
audiolib: miniaudio
- name: windows-xp
os: windows-2019
vs: vs2019
audiolib: miniaudio
xp: true
- name: windows-irrklang
os: windows-2022
vs: vs2022
audiolib: irrklang
- name: windows-no-dxsdk
os: windows-2022
vs: vs2022
audiolib: miniaudio
nodxsdk: true
- name: windows-x64
os: windows-2022
vs: vs2022
audiolib: miniaudio
x64: true
# - name: windows-2025
# os: windows-2025
# vs: vs2022
# audiolib: miniaudio
runs-on: ${{ matrix.os }}
......@@ -38,7 +71,7 @@ jobs:
id: premake
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/premake/premake-core/releases/download/v5.0.0-beta5/premake-5.0.0-beta5-windows.zip
url: https://github.com/premake/premake-core/releases/download/v5.0.0-beta6/premake-5.0.0-beta6-windows.zip
filename: premake5.zip
- name: Extract premake
......@@ -49,20 +82,19 @@ jobs:
id: libevent
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
url: https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
filename: libevent.tar.gz
- name: Extract libevent
run: |
tar xf ${{ steps.libevent.outputs.filepath }}
move libevent-2.0.22-stable event
xcopy /E event\WIN32-Code event\include
move libevent-2.1.12-stable event
- name: Download freetype
id: freetype
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: http://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
url: https://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
- name: Extract freetype
run: |
......@@ -169,6 +201,7 @@ jobs:
git clone --depth=1 https://github.com/mercury233/irrlicht
- name: Check DirectX SDK
if: matrix.nodxsdk != true
id: dxsdk
uses: actions/cache@v4
with:
......@@ -176,18 +209,19 @@ jobs:
path: DXSDK
- name: Download DirectX SDK
if: steps.dxsdk.outputs.cache-hit != 'true'
if: matrix.nodxsdk != true && steps.dxsdk.outputs.cache-hit != 'true'
id: dxsdk-download
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe
- name: Install DirectX SDK
if: steps.dxsdk.outputs.cache-hit != 'true'
if: matrix.nodxsdk != true && steps.dxsdk.outputs.cache-hit != 'true'
run: |
7z x ${{ steps.dxsdk-download.outputs.filepath }} -aoa
- name: Set DirectX SDK environment variable
if: matrix.nodxsdk != true
run: |
$dxsdkPath = Resolve-Path 'DXSDK'
"DXSDK_DIR=$($dxsdkPath.ProviderPath)\" | Out-File -FilePath $env:GITHUB_ENV -Append
......@@ -197,55 +231,44 @@ jobs:
xcopy /E premake\* .
xcopy /E resource\* .
- name: Use premake to generate Visual Studio solution (2019, miniaudio)
if: matrix.os == 'windows-2019' && matrix.audiolib == 'miniaudio'
run: |
.\premake5.exe vs2019 --winxp-support
- name: Use premake to generate Visual Studio solution (2022, miniaudio)
if: matrix.os == 'windows-2022' && matrix.audiolib == 'miniaudio'
- name: Use premake to generate Visual Studio solution
run: |
.\premake5.exe vs2022
- name: Use premake to generate Visual Studio solution (2019, irrKlang)
if: matrix.os == 'windows-2019' && matrix.audiolib == 'irrklang'
run: |
.\premake5.exe vs2019 --winxp-support --audio-lib=irrklang
- name: Use premake to generate Visual Studio solution (2022, irrKlang)
if: matrix.os == 'windows-2022' && matrix.audiolib == 'irrklang'
run: |
.\premake5.exe vs2022 --audio-lib=irrklang
.\premake5.exe ${{ matrix.vs }} --audio-lib=${{ matrix.audiolib }} ${{ matrix.xp && '--winxp-support' || '' }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build solution
run: |
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release /p:Platform=${{ matrix.x64 && 'x64' || 'Win32' }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: YGOPro-${{ matrix.os }}-${{ matrix.audiolib }}
name: YGOPro-${{ matrix.name }}
path: |
bin/release/YGOPro.exe
bin/release/x86/YGOPro.exe
bin/release/x64/YGOPro.exe
build-linux:
strategy:
fail-fast: false
matrix:
os:
# - ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
name:
- ubuntu-22
- ubuntu-24
- ubuntu-static-link
include:
# - os: ubuntu-20.04
# premake_version: 5.0.0-beta2
- os: ubuntu-22.04
premake_version: 5.0.0-beta4
- os: ubuntu-24.04
premake_version: 5.0.0-beta5
- name: ubuntu-22
os: ubuntu-22.04
premake-version: 5.0.0-beta4
- name: ubuntu-24
os: ubuntu-24.04
premake-version: 5.0.0-beta6
- name: ubuntu-static-link
os: ubuntu-22.04
premake-version: 5.0.0-beta4
static-link: true
runs-on: ${{ matrix.os }}
......@@ -270,13 +293,18 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libevent-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libsqlite3-dev libxxf86vm-dev libopusfile-dev libvorbis-dev
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libxxf86vm-dev
- name: Install dependencies (dynamic link)
if: matrix.static-link != true
run: |
sudo apt-get install -y libevent-dev libfreetype6-dev libsqlite3-dev libopusfile-dev libvorbis-dev
- name: Download premake
id: premake
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake_version }}/premake-${{ matrix.premake_version }}-linux.tar.gz
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake-version }}/premake-${{ matrix.premake-version }}-linux.tar.gz
filename: premake5.tar.gz
- name: Extract premake
......@@ -284,6 +312,41 @@ jobs:
tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5
- name: Download libevent
if: matrix.static-link == true
id: libevent
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
filename: libevent.tar.gz
- name: Extract libevent
if: matrix.static-link == true
run: |
tar xf ${{ steps.libevent.outputs.filepath }}
mv libevent-2.1.12-stable event
- name: Configure libevent
if: matrix.static-link == true
run: |
cd event
./configure --disable-openssl --enable-static=yes --enable-shared=no
sed -f make-event-config.sed < config.h > ./include/event2/event-config.h
cd ..
- name: Download freetype
if: matrix.static-link == true
id: freetype
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
- name: Extract freetype
if: matrix.static-link == true
run: |
tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.13.3 freetype
- name: Download lua
id: lua
uses: mercury233/action-cache-download-file@v1.0.0
......@@ -295,6 +358,19 @@ jobs:
tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.7 lua
- name: Download sqlite
if: matrix.static-link == true
id: sqlite
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip
- name: Extract sqlite
if: matrix.static-link == true
run: |
7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3490100 sqlite3
- name: Download miniaudio
run: |
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
......@@ -302,6 +378,65 @@ jobs:
cp extras/miniaudio_split/miniaudio.* .
cd ..
- name: Download ogg
if: matrix.static-link == true
id: ogg
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz
- name: Extract ogg
if: matrix.static-link == true
run: |
tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.5 miniaudio/external/ogg
- name: Configure ogg
if: matrix.static-link == true
run: |
cd miniaudio/external/ogg
./configure
cd ../../..
- name: Download opus
if: matrix.static-link == true
id: opus
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz
- name: Extract opus
if: matrix.static-link == true
run: |
tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus
- name: Download opusfile
if: matrix.static-link == true
id: opusfile
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz
- name: Extract opusfile
if: matrix.static-link == true
run: |
tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile
- name: Download vorbis
if: matrix.static-link == true
id: vorbis
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz
- name: Extract vorbis
if: matrix.static-link == true
run: |
tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis
- name: Download irrlicht
run: |
git clone --depth=1 https://github.com/mercury233/irrlicht
......@@ -311,20 +446,36 @@ jobs:
cp -r premake/* .
cp -r resource/* .
- name: Use premake to generate make files
- name: Use premake to generate make files (apt packages)
if: matrix.static-link != true
run: |
./premake5 gmake
- name: Use premake to generate make files (static link)
if: matrix.static-link == true
run: |
./premake5 gmake \
--build-event \
--build-freetype \
--build-sqlite \
--build-opus-vorbis
- name: Make
run: |
cd build
make -j 4 config=release
cd ..
- name: Strip symbols
run: |
cd bin/release
strip YGOPro
cd ../..
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: YGOPro-${{ matrix.os }}
name: YGOPro-${{ matrix.name }}
path: |
bin/release/YGOPro
......@@ -332,14 +483,36 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
- macos-13
- macos-15
name:
- macos-13-intel
- macos-13-arm-cross-compile-static-link
- macos-13-universal-static-link
- macos-15-arm
- macos-15-intel-cross-compile-static-link
- macos-15-universal-static-link
include:
- os: macos-13
premake_version: 5.0.0-beta5
- os: macos-15
premake_version: 5.0.0-beta5
- name: macos-13-intel
os: macos-13
- name: macos-13-arm-cross-compile-static-link
os: macos-13
cross-build-arm: true
static-link: true
- name: macos-13-universal-static-link
os: macos-13
cross-build-intel: true
cross-build-arm: true
static-link: true
- name: macos-15-arm
os: macos-15
- name: macos-15-intel-cross-compile-static-link
os: macos-15
cross-build-intel: true
static-link: true
- name: macos-15-universal-static-link
os: macos-15
cross-build-intel: true
cross-build-arm: true
static-link: true
runs-on: ${{ matrix.os }}
......@@ -362,20 +535,49 @@ jobs:
# cd ..
- name: Install dependencies
if: matrix.static-link != true
run: |
brew install freetype libevent libx11 sqlite opus opusfile libvorbis
brew install opus opusfile libvorbis
# brew install sqlite libx11 freetype libevent
- name: Download premake
id: premake
- name: Install premake
run: |
brew install premake
- name: Download libevent
if: matrix.static-link == true
id: libevent
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake_version }}/premake-${{ matrix.premake_version }}-macosx.tar.gz
filename: premake5.tar.gz
url: https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
filename: libevent.tar.gz
- name: Extract premake
- name: Extract libevent
if: matrix.static-link == true
run: |
tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5
tar xf ${{ steps.libevent.outputs.filepath }}
mv libevent-2.1.12-stable event
- name: Configure libevent
if: matrix.static-link == true
run: |
cd event
./configure --disable-openssl --enable-static=yes --enable-shared=no
sed -f make-event-config.sed < config.h > ./include/event2/event-config.h
cd ..
- name: Download freetype
if: matrix.static-link == true
id: freetype
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://downloads.sourceforge.net/freetype/freetype-2.13.3.tar.gz
- name: Extract freetype
if: matrix.static-link == true
run: |
tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.13.3 freetype
- name: Download lua
id: lua
......@@ -388,6 +590,19 @@ jobs:
tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.7 lua
- name: Download sqlite
if: matrix.static-link == true
id: sqlite
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip
- name: Extract sqlite
if: matrix.static-link == true
run: |
7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3490100 sqlite3
- name: Download miniaudio
run: |
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
......@@ -395,6 +610,58 @@ jobs:
cp extras/miniaudio_split/miniaudio.* .
cd ..
- name: Download ogg
if: matrix.static-link == true
id: ogg
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz
- name: Extract ogg
if: matrix.static-link == true
run: |
tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.5 miniaudio/external/ogg
- name: Download opus
if: matrix.static-link == true
id: opus
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz
- name: Extract opus
if: matrix.static-link == true
run: |
tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus
- name: Download opusfile
if: matrix.static-link == true
id: opusfile
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz
- name: Extract opusfile
if: matrix.static-link == true
run: |
tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile
- name: Download vorbis
if: matrix.static-link == true
id: vorbis
uses: mercury233/action-cache-download-file@v1.0.0
with:
url: https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz
- name: Extract vorbis
if: matrix.static-link == true
run: |
tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis
- name: Download irrlicht
run: |
git clone --depth=1 https://github.com/mercury233/irrlicht
......@@ -404,9 +671,19 @@ jobs:
cp -r premake/* .
cp -r resource/* .
- name: Use premake to generate make files
- name: Use premake to generate make files (Homebrew packages)
if: matrix.static-link != true
run: |
DYLD_LIBRARY_PATH=$(brew --prefix)/lib premake5 gmake
- name: Use premake to generate make files (static link)
if: matrix.static-link == true
run: |
DYLD_LIBRARY_PATH=$(brew --prefix)/lib ./premake5 gmake --cc=clang
premake5 gmake ${{ matrix.cross-build-intel == true && '--mac-intel' || '' }} ${{ matrix.cross-build-arm == true && '--mac-arm' || '' }} \
--build-event \
--build-freetype \
--build-sqlite \
--build-opus-vorbis
- name: Make
run: |
......@@ -417,6 +694,6 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: YGOPro-${{ matrix.os }}
name: YGOPro-${{ matrix.name }}
path: |
bin/*
bin/release/YGOPro.app
......@@ -14,14 +14,17 @@ mat_common:
- linux
script:
# lua
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/lua-5.4.4.tar.gz | tar zfx -
- mv lua-5.4.4 lua
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/lua-5.4.7.tar.gz | tar zfx -
- mv lua-5.4.7 lua
# sqlite3
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/sqlite-autoconf-3390300.tar.gz | tar zfx -
- mv sqlite-autoconf-3390300 sqlite3
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/sqlite-autoconf-3490100.tar.gz | tar zfx -
- mv sqlite-autoconf-3490100 sqlite3
# freetype
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/freetype-2.11.1.tar.gz | tar zfx -
- mv freetype-2.11.1 freetype
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/freetype-2.13.3.tar.gz | tar zfx -
- mv freetype-2.13.3 freetype
# event
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/libevent-2.1.12-stable.tar.gz | tar zfx -
- mv libevent-2.1.12-stable event
# irrlicht
- ./.ci/prepare-irrlicht.sh
# miniaudio
......@@ -33,6 +36,7 @@ mat_common:
- lua
- freetype
- sqlite3
- event
- irrlicht
- miniaudio
......@@ -68,7 +72,7 @@ mat_macos:
- linux
script:
- apt update; apt -y install wget tar
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/premake-5.0.0-beta5-macosx.tar.gz | tar zfx -
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/premake-5.0.0-beta6-macosx.tar.gz | tar zfx -
- chmod +x premake5
artifacts:
paths:
......@@ -81,25 +85,21 @@ mat_windows:
script:
- apt update; apt -y install wget tar patch p7zip-full
# premake5.exe
- wget https://cdn02.moecube.com:444/ygopro-build-materials/premake-5.0.0-beta5-windows.zip
- 7z x -y premake-5.0.0-beta5-windows.zip
# event
- wget -O - https://cdn02.moecube.com:444/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
- mv libevent-2.0.22-stable event
- wget https://cdn02.moecube.com:444/ygopro-build-materials/premake-5.0.0-beta6-windows.zip
- 7z x -y premake-5.0.0-beta6-windows.zip
artifacts:
paths:
- premake5.exe
- event
._exec_build:
stage: build
variables:
NO_LUA_SAFE: '1' # on client no lua safe
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- bin/
- obj/
#cache:
# key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
# paths:
# - bin/
# - obj/
exec_windows:
extends: ._exec_build
......@@ -112,14 +112,28 @@ exec_windows:
script:
- bash -c 'cp -rf premake/* . ; cp -rf resource/* .'
- '.\premake5.exe vs2019'
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release'
- copy bin\release\ygopro.exe .
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release /p:Platform=x64'
- copy bin\release\x64\ygopro.exe .
artifacts:
paths:
- ygopro.exe
.exec_linux:
.exec_unix:
extends: ._exec_build
variables:
BUILD_FREETYPE: '1'
BUILD_SQLITE: '1'
BUILD_IRRLICHT: '1'
BUILD_EVENT: '1'
BUILD_OPUS_VORBIS: '1'
AUDIO_LIB: 'miniaudio'
MINIAUDIO_SUPPORT_OPUS_VORBIS: '1'
BUILD_OPUS_VORBIS: '1'
before_script:
- ./.ci/configure-libevent.sh
.exec_linux:
extends: .exec_unix
tags:
- linux
image: git-registry.moenext.com/mycard/docker-ygopro-builder
......@@ -127,20 +141,9 @@ exec_windows:
- mat_common
#- mat_linux
- mat_submodules
variables:
EVENT_INCLUDE_DIR: /usr/share/libevent-stable/include
EVENT_LIB_DIR: /usr/share/libevent-stable/lib
OPUS_INCLUDE_DIR: $CI_PROJECT_DIR/miniaudio/external-built/include/opus
OPUS_LIB_DIR: $CI_PROJECT_DIR/miniaudio/external-built/lib
OPUSFILE_INCLUDE_DIR: $CI_PROJECT_DIR/miniaudio/external-built/include/opus
OPUSFILE_LIB_DIR: $CI_PROJECT_DIR/miniaudio/external-built/lib
VORBIS_INCLUDE_DIR: $CI_PROJECT_DIR/miniaudio/external-built/include
VORBIS_LIB_DIR: $CI_PROJECT_DIR/miniaudio/external-built/lib
OGG_INCLUDE_DIR: $CI_PROJECT_DIR/miniaudio/external-built/include
OGG_LIB_DIR: $CI_PROJECT_DIR/miniaudio/external-built/lib
script:
- ./.ci/build-opus.sh
- premake5 gmake --build-freetype --build-sqlite
- ./.ci/configure-audio.sh
- premake5 gmake
- cd build
- make config=release -j$(nproc)
- cd ..
......@@ -152,6 +155,8 @@ exec_windows:
exec_linux:
extends: .exec_linux
tags:
- avx2
exec_linuxarm:
extends: .exec_linux
......@@ -163,7 +168,7 @@ exec_linuxarm:
image: git-registry.moenext.com/mycard/docker-ygopro-builder:fpic # use a special docker image for arm build, which has fPIC enabled by default
._exec_macos_platform:
extends: ._exec_build
extends: .exec_unix
dependencies:
- mat_macos
- mat_common
......
......@@ -16,6 +16,7 @@ project "YGOPro"
else
includedirs { EVENT_INCLUDE_DIR }
libdirs { EVENT_LIB_DIR }
links { "event_pthreads" }
end
if BUILD_IRRLICHT then
......@@ -67,9 +68,10 @@ project "YGOPro"
end
filter "system:windows"
entrypoint "mainCRTStartup"
defines { "_IRR_WCHAR_FILESYSTEM" }
files "ygopro.rc"
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32", "Dnsapi" }
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32", "Dnsapi", "iphlpapi" }
if USE_AUDIO and AUDIO_LIB == "irrklang" then
links { "irrKlang" }
if IRRKLANG_PRO then
......@@ -82,15 +84,17 @@ project "YGOPro"
end
end
filter "not system:windows"
links { "event_pthreads", "dl", "pthread", "resolv" }
links { "dl", "pthread", "resolv" }
filter "system:macosx"
openmp "Off"
links { "z" }
defines { "GL_SILENCE_DEPRECATION" }
if MAC_ARM then
buildoptions { "--target=arm64-apple-macos12" }
linkoptions { "-arch arm64" }
end
if MAC_INTEL then
linkoptions { "-arch x86_64" }
end
if USE_AUDIO and AUDIO_LIB == "irrklang" then
links { "irrklang" }
end
......
Subproject commit ab7ef30f678a7356e0fca85b0091fcdf56581b35
Subproject commit 15b26798847a8af75b7f1f03a9a7df1583ae96af
......@@ -8,7 +8,18 @@ project "event"
"evmap.c", "log.c", "evutil.c", "evutil_rand.c", "strlcpy.c", "signal.c",
"event_tagging.c", "http.c", "evdns.c", "evrpc.c" }
if os.isfile("evutil_time.c") then
files { "evutil_time.c" }
end
filter "system:windows"
prebuildcommands { "xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code $(ProjectDir)..\\event\\include" }
prebuildcommands { "xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code $(ProjectDir)..\\event\\include",
"xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code\\nmake $(ProjectDir)..\\event\\include" }
files { "win32select.c", "evthread_win32.c", "buffer_iocp.c", "event_iocp.c", "bufferevent_async.c" }
defines { "WIN32" } -- quirk of old libevent
defines { "UINT32_MAX=0xffffffffui32" } -- quirk of libevent 2.1.2
filter "system:linux"
files { "evthread_pthread.c", "epoll.c", "epoll_sub.c", "poll.c", "select.c" }
filter "system:macosx"
files { "evthread_pthread.c", "kqueue.c", "poll.c", "select.c" }
......@@ -155,7 +155,11 @@ project "irrlicht"
filter { "system:windows" }
defines { "_IRR_WCHAR_FILESYSTEM" }
includedirs { "$(DXSDK_DIR)Include" }
if USE_DXSDK then
includedirs { "$(DXSDK_DIR)Include" }
else
defines { "NO_IRR_COMPILE_WITH_DIRECT3D_9_" }
end
filter { "system:linux" }
links { "X11", "Xxf86vm" }
......
......@@ -33,12 +33,6 @@ project "miniaudio"
"external/opus/celt/rate.c",
"external/opus/celt/vq.c",
"external/opus/celt/x86/pitch_avx.c",
"external/opus/celt/x86/pitch_sse.c",
"external/opus/celt/x86/vq_sse2.c",
"external/opus/celt/x86/x86_celt_map.c",
"external/opus/celt/x86/x86cpu.c",
"external/opus/silk/bwexpander.c",
"external/opus/silk/bwexpander_32.c",
"external/opus/silk/CNG.c",
......@@ -118,10 +112,25 @@ project "miniaudio"
"external/vorbis/include",
}
defines {
"OPUS_BUILD", "USE_ALLOCA", "HAVE_LRINTF", "OP_HAVE_LRINTF",
"OPUS_X86_PRESUME_SSE", "OPUS_X86_PRESUME_SSE2",
"OPUS_HAVE_RTCD", "OPUS_X86_MAY_HAVE_SSE", "OPUS_X86_MAY_HAVE_SSE4_1", "OPUS_X86_MAY_HAVE_AVX2",
"OPUS_BUILD",
"USE_ALLOCA",
"HAVE_LRINTF",
"OP_HAVE_LRINTF",
}
if not TARGET_MAC_ARM and not IS_ARM and not MAC_INTEL then
files {
"external/opus/celt/x86/pitch_avx.c",
"external/opus/celt/x86/pitch_sse.c",
"external/opus/celt/x86/vq_sse2.c",
"external/opus/celt/x86/x86_celt_map.c",
"external/opus/celt/x86/x86cpu.c",
}
defines {
"OPUS_HAVE_RTCD", "CPU_INFO_BY_ASM",
"OPUS_X86_PRESUME_SSE", "OPUS_X86_PRESUME_SSE2",
"OPUS_X86_MAY_HAVE_SSE", "OPUS_X86_MAY_HAVE_SSE4_1", "OPUS_X86_MAY_HAVE_AVX2",
}
end
else
includedirs { OPUS_INCLUDE_DIR, OPUSFILE_INCLUDE_DIR, VORBIS_INCLUDE_DIR, OGG_INCLUDE_DIR }
end
......
-- default global settings
-- Supported systems: Windows, Linux, MacOS
-- Global settings
-- Default: Build Lua, Irrlicht from source on all systems.
-- Don't build event, freetype, sqlite, opus, vorbis on Linux or MacOS, use apt or homebrew,
-- but build them on Windows, due to the lack of package manager on Windows.
BUILD_LUA = true
LUA_LIB_NAME = "lua"
LUA_LIB_NAME = "lua" -- change this if you don't build Lua
BUILD_EVENT = os.istarget("windows")
BUILD_FREETYPE = os.istarget("windows")
BUILD_SQLITE = os.istarget("windows")
BUILD_IRRLICHT = true
BUILD_IRRLICHT = true -- modified Irrlicht is required, can't use the official one
USE_DXSDK = true
USE_AUDIO = true
AUDIO_LIB = "miniaudio"
AUDIO_LIB = "miniaudio" -- can be "miniaudio" or "irrklang"
-- BUILD_MINIAUDIO is always true
MINIAUDIO_SUPPORT_OPUS_VORBIS = true
MINIAUDIO_BUILD_OPUS_VORBIS = os.istarget("windows")
-- BUILD_IRRKLANG is impossible because irrKlang is not open source
IRRKLANG_PRO = false
IRRKLANG_PRO_BUILD_IKPMP3 = false
-- read settings from command line or environment variables
-- Read settings from command line or environment variables
newoption { trigger = "build-lua", category = "YGOPro - lua", description = "" }
newoption { trigger = "no-build-lua", category = "YGOPro - lua", description = "" }
......@@ -43,6 +52,7 @@ newoption { trigger = "build-irrlicht", category = "YGOPro - irrlicht", descript
newoption { trigger = "no-build-irrlicht", category = "YGOPro - irrlicht", description = "" }
newoption { trigger = "irrlicht-include-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" }
newoption { trigger = "irrlicht-lib-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" }
newoption { trigger = "no-dxsdk", category = "YGOPro - irrlicht", description = "" }
newoption { trigger = "no-audio", category = "YGOPro", description = "" }
newoption { trigger = "audio-lib", category = "YGOPro", description = "", value = "miniaudio, irrklang", default = AUDIO_LIB }
......@@ -72,7 +82,8 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan
newoption { trigger = 'build-ikpmp3', category = "YGOPro - irrklang - ikpmp3", description = "" }
newoption { trigger = "winxp-support", category = "YGOPro", description = "" }
newoption { trigger = "mac-arm", category = "YGOPro", description = "Cross compile for Apple Silicon" }
newoption { trigger = "mac-arm", category = "YGOPro", description = "Compile for Apple Silicon Mac" }
newoption { trigger = "mac-intel", category = "YGOPro", description = "Compile for Intel Mac" }
-- koishipro specific
......@@ -134,9 +145,9 @@ elseif GetParam("no-build-lua") then
BUILD_LUA = false
end
if not BUILD_LUA then
-- at most times you need to change this if you change BUILD_LUA to false
-- at most times you need to change those if you change BUILD_LUA to false
-- make sure your lua lib is built with C++ and version >= 5.3
LUA_LIB_NAME = GetParam("lua-lib-name")
LUA_LIB_NAME = GetParam("lua-lib-name") or LUA_LIB_NAME
LUA_INCLUDE_DIR = GetParam("lua-include-dir") or os.findheader("lua.h")
LUA_LIB_DIR = GetParam("lua-lib-dir") or os.findlib(LUA_LIB_NAME)
end
......@@ -162,7 +173,7 @@ if GetParam("lua-deb") then
end
if GetParam("build-event") then
BUILD_EVENT = os.istarget("windows") -- only on windows for now
BUILD_EVENT = true
elseif GetParam("no-build-event") then
BUILD_EVENT = false
end
......@@ -201,6 +212,16 @@ if not BUILD_IRRLICHT then
IRRLICHT_LIB_DIR = GetParam("irrlicht-lib-dir") or os.findlib("irrlicht")
end
if GetParam("no-dxsdk") then
USE_DXSDK = false
end
if USE_DXSDK and os.istarget("windows") then
if not os.getenv("DXSDK_DIR") then
print("DXSDK_DIR environment variable not set, it seems you don't have the DirectX SDK installed. DirectX mode will be disabled.")
USE_DXSDK = false
end
end
if GetParam("no-audio") then
USE_AUDIO = false
elseif GetParam("no-use-miniaudio") then
......@@ -293,8 +314,9 @@ function spawn(cmd)
end
function isRunningUnderRosetta()
local rosetta_result=spawn("sysctl -n sysctl.proc_translated 2>/dev/null")
return tonumber(rosetta_result) == 1
local uname = os.outputof("uname -m")
local proctranslated = os.outputof("sysctl sysctl.proc_translated")
return uname:find("arm") or proctranslated
end
function IsRunningUnderARM()
......@@ -336,8 +358,25 @@ function isARM()
return false
end
IS_ARM=isARM() or GetParam("mac-arm") -- detect if the current system is ARM
MAC_ARM=os.istarget("macosx") and IS_ARM
IS_ARM=isARM()
if os.istarget("macosx") then
if GetParam("mac-arm") then
MAC_ARM = true
end
if GetParam("mac-intel") then
MAC_INTEL = true
end
if MAC_ARM then
TARGET_MAC_ARM = true
elseif not MAC_INTEL then
-- automatic target arm64, need extra detect
if isRunningUnderRosetta() then
TARGET_MAC_ARM = true
end
end
end
workspace "YGOPro"
location "build"
......@@ -357,7 +396,6 @@ workspace "YGOPro"
filter "system:windows"
entrypoint "mainCRTStartup"
systemversion "latest"
startproject "YGOPro"
if WINXP_SUPPORT then
......@@ -366,11 +404,24 @@ workspace "YGOPro"
else
defines { "WINVER=0x0601" } -- WIN7
end
platforms { "Win32", "x64" }
filter { "system:windows", "platforms:Win32" }
architecture "x86"
filter { "system:windows", "platforms:x64" }
architecture "x86_64"
filter "system:macosx"
libdirs { "/usr/local/lib" }
if MAC_ARM then
buildoptions { "--target=arm64-apple-macos12" }
buildoptions { "-arch arm64" }
end
if MAC_INTEL then
buildoptions { "-arch x86_64", "-mavx", "-mfma" }
end
if MAC_ARM and MAC_INTEL then
architecture "universal"
end
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
......@@ -386,6 +437,18 @@ workspace "YGOPro"
defines "_DEBUG"
targetdir "bin/debug"
filter { "system:windows", "platforms:Win32", "configurations:Release" }
targetdir "bin/release/x86"
filter { "system:windows", "platforms:Win32", "configurations:Debug" }
targetdir "bin/debug/x86"
filter { "system:windows", "platforms:x64", "configurations:Release" }
targetdir "bin/release/x64"
filter { "system:windows", "platforms:x64", "configurations:Debug" }
targetdir "bin/debug/x64"
filter { "configurations:Release", "action:vs*" }
if linktimeoptimization then
linktimeoptimization "On"
......@@ -398,17 +461,6 @@ workspace "YGOPro"
filter { "configurations:Release", "not action:vs*" }
symbols "On"
defines "NDEBUG"
if not IS_ARM then
buildoptions "-march=native"
end
if IS_ARM and not MAC_ARM then
buildoptions {
"-march=armv8-a",
"-mtune=cortex-a72",
"-Wno-psabi"
}
pic "On"
end
filter { "configurations:Debug", "action:vs*" }
disablewarnings { "6011", "6031", "6054", "6262" }
......@@ -424,6 +476,17 @@ workspace "YGOPro"
filter "not action:vs*"
buildoptions { "-fno-strict-aliasing", "-Wno-multichar", "-Wno-format-security" }
if not IS_ARM and not MAC_INTEL then
buildoptions "-march=native"
end
if IS_ARM and not MAC_ARM then
buildoptions {
"-march=armv8-a",
"-mtune=cortex-a72",
"-Wno-psabi"
}
pic "On"
end
filter {}
......
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