Commit de9fe43e authored by mercury233's avatar mercury233

make static link not default

parent 9fea147d
...@@ -237,7 +237,7 @@ jobs: ...@@ -237,7 +237,7 @@ jobs:
name: name:
- ubuntu-22 - ubuntu-22
- ubuntu-24 - ubuntu-24
- ubuntu-dynamic-link - ubuntu-static-link
include: include:
- name: ubuntu-22 - name: ubuntu-22
os: ubuntu-22.04 os: ubuntu-22.04
...@@ -245,10 +245,10 @@ jobs: ...@@ -245,10 +245,10 @@ jobs:
- name: ubuntu-24 - name: ubuntu-24
os: ubuntu-24.04 os: ubuntu-24.04
premake-version: 5.0.0-beta6 premake-version: 5.0.0-beta6
- name: ubuntu-dynamic-link - name: ubuntu-static-link
os: ubuntu-22.04 os: ubuntu-22.04
premake-version: 5.0.0-beta4 premake-version: 5.0.0-beta4
dynamic-link: true static-link: true
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
...@@ -275,8 +275,8 @@ jobs: ...@@ -275,8 +275,8 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libxxf86vm-dev sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev libxxf86vm-dev
- name: Install dependencies (dynamic lib) - name: Install dependencies (dynamic link)
if: matrix.dynamic-link == true if: matrix.static-link != true
run: | run: |
sudo apt-get install -y libevent-dev libfreetype6-dev libsqlite3-dev libopusfile-dev libvorbis-dev sudo apt-get install -y libevent-dev libfreetype6-dev libsqlite3-dev libopusfile-dev libvorbis-dev
...@@ -293,7 +293,7 @@ jobs: ...@@ -293,7 +293,7 @@ jobs:
chmod +x ./premake5 chmod +x ./premake5
- name: Download libevent - name: Download libevent
if: matrix.dynamic-link != true if: matrix.static-link == true
id: libevent id: libevent
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
...@@ -301,13 +301,13 @@ jobs: ...@@ -301,13 +301,13 @@ jobs:
filename: libevent.tar.gz filename: libevent.tar.gz
- name: Extract libevent - name: Extract libevent
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.libevent.outputs.filepath }} tar xf ${{ steps.libevent.outputs.filepath }}
mv libevent-2.1.12-stable event mv libevent-2.1.12-stable event
- name: Configure libevent - name: Configure libevent
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
cd event cd event
./configure --disable-openssl --enable-static=yes --enable-shared=no ./configure --disable-openssl --enable-static=yes --enable-shared=no
...@@ -315,14 +315,14 @@ jobs: ...@@ -315,14 +315,14 @@ jobs:
cd .. cd ..
- name: Download freetype - name: Download freetype
if: matrix.dynamic-link != true if: matrix.static-link == true
id: freetype id: freetype
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://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 - name: Extract freetype
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.freetype.outputs.filepath }} tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.13.3 freetype mv freetype-2.13.3 freetype
...@@ -339,14 +339,14 @@ jobs: ...@@ -339,14 +339,14 @@ jobs:
mv lua-5.4.7 lua mv lua-5.4.7 lua
- name: Download sqlite - name: Download sqlite
if: matrix.dynamic-link != true if: matrix.static-link == true
id: sqlite id: sqlite
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip url: https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip
- name: Extract sqlite - name: Extract sqlite
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
7z x ${{ steps.sqlite.outputs.filepath }} 7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3490100 sqlite3 mv sqlite-amalgamation-3490100 sqlite3
...@@ -359,60 +359,60 @@ jobs: ...@@ -359,60 +359,60 @@ jobs:
cd .. cd ..
- name: Download ogg - name: Download ogg
if: matrix.dynamic-link != true if: matrix.static-link == true
id: ogg id: ogg
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz url: https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz
- name: Extract ogg - name: Extract ogg
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.ogg.outputs.filepath }} tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.5 miniaudio/external/ogg mv libogg-1.3.5 miniaudio/external/ogg
- name: Configure ogg - name: Configure ogg
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
cd miniaudio/external/ogg cd miniaudio/external/ogg
./configure ./configure
cd ../../.. cd ../../..
- name: Download opus - name: Download opus
if: matrix.dynamic-link != true if: matrix.static-link == true
id: opus id: opus
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz url: https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz
- name: Extract opus - name: Extract opus
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.opus.outputs.filepath }} tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus mv opus-1.5.2 miniaudio/external/opus
- name: Download opusfile - name: Download opusfile
if: matrix.dynamic-link != true if: matrix.static-link == true
id: opusfile id: opusfile
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz url: https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz
- name: Extract opusfile - name: Extract opusfile
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.opusfile.outputs.filepath }} tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile mv opusfile-0.12 miniaudio/external/opusfile
- name: Download vorbis - name: Download vorbis
if: matrix.dynamic-link != true if: matrix.static-link == true
id: vorbis id: vorbis
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz url: https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz
- name: Extract vorbis - name: Extract vorbis
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.vorbis.outputs.filepath }} tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis mv libvorbis-1.3.7 miniaudio/external/vorbis
...@@ -427,20 +427,20 @@ jobs: ...@@ -427,20 +427,20 @@ jobs:
cp -r resource/* . cp -r resource/* .
- name: Use premake to generate make files (apt packages) - name: Use premake to generate make files (apt packages)
if: matrix.dynamic-link == true if: matrix.static-link != true
run: | run: |
./premake5 gmake \ ./premake5 gmake \
--no-build-event \
--no-build-freetype \
--no-build-sqlite \
--no-build-opus-vorbis \
--freetype-include-dir="/usr/include/freetype2" \ --freetype-include-dir="/usr/include/freetype2" \
--opus-include-dir="/usr/include/opus" --opus-include-dir="/usr/include/opus"
- name: Use premake to generate make files - name: Use premake to generate make files (static link)
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
./premake5 gmake ./premake5 gmake \
--build-event \
--build-freetype \
--build-sqlite \
--build-opus-vorbis
- name: Make - name: Make
run: | run: |
...@@ -467,41 +467,34 @@ jobs: ...@@ -467,41 +467,34 @@ jobs:
matrix: matrix:
name: name:
- macos-13-intel - macos-13-intel
- macos-13-arm-crossbuild - macos-13-arm-cross-compile-static-link
- macos-13-universal - macos-13-universal-static-link
- macos-15-arm - macos-15-arm
- macos-15-intel-crossbuild - macos-15-intel-cross-compile-static-link
- macos-15-universal - macos-15-universal-static-link
- macos-dynamic-link
include: include:
- name: macos-13-intel - name: macos-13-intel
os: macos-13 os: macos-13
premake-version: 5.0.0-beta6 - name: macos-13-arm-cross-compile-static-link
- name: macos-13-arm-crossbuild
os: macos-13 os: macos-13
premake-version: 5.0.0-beta6
cross-build-arm: true cross-build-arm: true
- name: macos-13-universal static-link: true
- name: macos-13-universal-static-link
os: macos-13 os: macos-13
premake-version: 5.0.0-beta6
cross-build-intel: true cross-build-intel: true
cross-build-arm: true cross-build-arm: true
static-link: true
- name: macos-15-arm - name: macos-15-arm
os: macos-15 os: macos-15
premake-version: 5.0.0-beta6 - name: macos-15-intel-cross-compile-static-link
- name: macos-15-intel-crossbuild
os: macos-15 os: macos-15
premake-version: 5.0.0-beta6
cross-build-intel: true cross-build-intel: true
- name: macos-15-universal static-link: true
- name: macos-15-universal-static-link
os: macos-15 os: macos-15
premake-version: 5.0.0-beta6
cross-build-intel: true cross-build-intel: true
cross-build-arm: true cross-build-arm: true
- name: macos-dynamic-link static-link: true
os: macos-13
premake-version: 5.0.0-beta6
dynamic-link: true
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
...@@ -524,7 +517,7 @@ jobs: ...@@ -524,7 +517,7 @@ jobs:
# cd .. # cd ..
- name: Install dependencies - name: Install dependencies
if: matrix.dynamic-link == true if: matrix.static-link != true
run: | run: |
brew install opus opusfile libvorbis brew install opus opusfile libvorbis
# brew install sqlite libx11 freetype libevent # brew install sqlite libx11 freetype libevent
...@@ -534,7 +527,7 @@ jobs: ...@@ -534,7 +527,7 @@ jobs:
brew install premake brew install premake
- name: Download libevent - name: Download libevent
if: matrix.dynamic-link != true if: matrix.static-link == true
id: libevent id: libevent
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
...@@ -542,13 +535,13 @@ jobs: ...@@ -542,13 +535,13 @@ jobs:
filename: libevent.tar.gz filename: libevent.tar.gz
- name: Extract libevent - name: Extract libevent
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.libevent.outputs.filepath }} tar xf ${{ steps.libevent.outputs.filepath }}
mv libevent-2.1.12-stable event mv libevent-2.1.12-stable event
- name: Configure libevent - name: Configure libevent
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
cd event cd event
./configure --disable-openssl --enable-static=yes --enable-shared=no ./configure --disable-openssl --enable-static=yes --enable-shared=no
...@@ -556,14 +549,14 @@ jobs: ...@@ -556,14 +549,14 @@ jobs:
cd .. cd ..
- name: Download freetype - name: Download freetype
if: matrix.dynamic-link != true if: matrix.static-link == true
id: freetype id: freetype
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://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 - name: Extract freetype
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.freetype.outputs.filepath }} tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.13.3 freetype mv freetype-2.13.3 freetype
...@@ -580,14 +573,14 @@ jobs: ...@@ -580,14 +573,14 @@ jobs:
mv lua-5.4.7 lua mv lua-5.4.7 lua
- name: Download sqlite - name: Download sqlite
if: matrix.dynamic-link != true if: matrix.static-link == true
id: sqlite id: sqlite
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip url: https://www.sqlite.org/2025/sqlite-amalgamation-3490100.zip
- name: Extract sqlite - name: Extract sqlite
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
7z x ${{ steps.sqlite.outputs.filepath }} 7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3490100 sqlite3 mv sqlite-amalgamation-3490100 sqlite3
...@@ -600,53 +593,53 @@ jobs: ...@@ -600,53 +593,53 @@ jobs:
cd .. cd ..
- name: Download ogg - name: Download ogg
if: matrix.dynamic-link != true if: matrix.static-link == true
id: ogg id: ogg
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz url: https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.gz
- name: Extract ogg - name: Extract ogg
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.ogg.outputs.filepath }} tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.5 miniaudio/external/ogg mv libogg-1.3.5 miniaudio/external/ogg
- name: Download opus - name: Download opus
if: matrix.dynamic-link != true if: matrix.static-link == true
id: opus id: opus
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz url: https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz
- name: Extract opus - name: Extract opus
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.opus.outputs.filepath }} tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus mv opus-1.5.2 miniaudio/external/opus
- name: Download opusfile - name: Download opusfile
if: matrix.dynamic-link != true if: matrix.static-link == true
id: opusfile id: opusfile
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz url: https://github.com/xiph/opusfile/releases/download/v0.12/opusfile-0.12.tar.gz
- name: Extract opusfile - name: Extract opusfile
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.opusfile.outputs.filepath }} tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile mv opusfile-0.12 miniaudio/external/opusfile
- name: Download vorbis - name: Download vorbis
if: matrix.dynamic-link != true if: matrix.static-link == true
id: vorbis id: vorbis
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz url: https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.gz
- name: Extract vorbis - name: Extract vorbis
if: matrix.dynamic-link != true if: matrix.static-link == true
run: | run: |
tar xf ${{ steps.vorbis.outputs.filepath }} tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis mv libvorbis-1.3.7 miniaudio/external/vorbis
...@@ -660,21 +653,36 @@ jobs: ...@@ -660,21 +653,36 @@ jobs:
cp -r premake/* . cp -r premake/* .
cp -r resource/* . cp -r resource/* .
- name: Use premake to generate make files (homebrew packages) - name: Use premake to generate make files (homebrew packages, Intel)
if: matrix.dynamic-link == true if: matrix.static-link != true && runner.arch == 'X64'
run: | run: |
premake5 gmake \ premake5 gmake ${{ matrix.cross-build-intel == true && '--mac-intel' || '' }} ${{ matrix.cross-build-arm == true && '--mac-arm' || '' }} \
--no-build-event \
--no-build-freetype \
--no-build-sqlite \
--no-build-opus-vorbis \
--freetype-include-dir="/usr/local/include/freetype2" \ --freetype-include-dir="/usr/local/include/freetype2" \
--opus-include-dir="/usr/local/include/opus" --opus-include-dir="/usr/local/include/opus"
- name: Use premake to generate make files - name: Use premake to generate make files (homebrew packages, Apple Silicon)
if: matrix.dynamic-link != true if: matrix.static-link != true && runner.arch == 'ARM64'
run: | run: |
./premake5 gmake ${{ matrix.cross-build-intel == true && '--mac-intel' || '' }} ${{ matrix.cross-build-arm == true && '--mac-arm' || '' }} premake5 gmake ${{ matrix.cross-build-intel == true && '--mac-intel' || '' }} ${{ matrix.cross-build-arm == true && '--mac-arm' || '' }} \
--event-include-dir="/opt/homebrew/include" \
--event-lib-dir="/opt/homebrew/lib" \
--freetype-include-dir="/opt/homebrew/include/freetype2" \
--freetype-lib-dir="/opt/homebrew/lib" \
--sqlite-include-dir="/opt/homebrew/opt/sqlite/include" \
--sqlite-lib-dir="/opt/homebrew/opt/sqlite/lib" \
--opus-include-dir="/opt/homebrew/include/opus" \
--opus-lib-dir="/opt/homebrew/lib" \
--vorbis-include-dir="/opt/homebrew/include" \
--vorbis-lib-dir="/opt/homebrew/lib"
- name: Use premake to generate make files (static link)
if: matrix.static-link == true
run: |
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 - name: Make
run: | run: |
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
BUILD_LUA = true BUILD_LUA = true
LUA_LIB_NAME = "lua" LUA_LIB_NAME = "lua"
BUILD_EVENT = true BUILD_EVENT = os.istarget("windows")
BUILD_FREETYPE = true BUILD_FREETYPE = os.istarget("windows")
BUILD_SQLITE = true BUILD_SQLITE = os.istarget("windows")
BUILD_IRRLICHT = true BUILD_IRRLICHT = true
...@@ -13,7 +13,7 @@ USE_AUDIO = true ...@@ -13,7 +13,7 @@ USE_AUDIO = true
AUDIO_LIB = "miniaudio" AUDIO_LIB = "miniaudio"
-- BUILD_MINIAUDIO is always true -- BUILD_MINIAUDIO is always true
MINIAUDIO_SUPPORT_OPUS_VORBIS = true MINIAUDIO_SUPPORT_OPUS_VORBIS = true
MINIAUDIO_BUILD_OPUS_VORBIS = true MINIAUDIO_BUILD_OPUS_VORBIS = os.istarget("windows")
-- BUILD_IRRKLANG is impossible because irrKlang is not open source -- BUILD_IRRKLANG is impossible because irrKlang is not open source
IRRKLANG_PRO = false IRRKLANG_PRO = false
IRRKLANG_PRO_BUILD_IKPMP3 = false IRRKLANG_PRO_BUILD_IKPMP3 = false
......
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