Commit a10898c0 authored by mercury233's avatar mercury233

add static build for linux & macos

parent 6ab02b31
...@@ -61,7 +61,7 @@ jobs: ...@@ -61,7 +61,7 @@ jobs:
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: 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 - name: Extract freetype
run: | run: |
...@@ -234,17 +234,21 @@ jobs: ...@@ -234,17 +234,21 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: name:
# - ubuntu-20.04 - ubuntu-22
- ubuntu-22.04 - ubuntu-24
- ubuntu-24.04 - ubuntu-dynamic-link
include: include:
# - os: ubuntu-20.04 - name: ubuntu-22
# premake_version: 5.0.0-beta2 os: ubuntu-22.04
- os: ubuntu-22.04 premake-version: 5.0.0-beta4
premake_version: 5.0.0-beta4 - name: ubuntu-24
- os: ubuntu-24.04 os: ubuntu-24.04
premake_version: 5.0.0-beta5 premake-version: 5.0.0-beta6
- name: ubuntu-dynamic-link
os: ubuntu-22.04
premake-version: 5.0.0-beta4
dynamic-link: true
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
...@@ -269,13 +273,18 @@ jobs: ...@@ -269,13 +273,18 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update 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 lib)
if: matrix.dynamic-link == true
run: |
sudo apt-get install -y libevent-dev libfreetype6-dev libsqlite3-dev libopusfile-dev libvorbis-dev
- name: Download premake - name: Download premake
id: premake id: premake
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: 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 filename: premake5.tar.gz
- name: Extract premake - name: Extract premake
...@@ -283,6 +292,41 @@ jobs: ...@@ -283,6 +292,41 @@ jobs:
tar xf ${{ steps.premake.outputs.filepath }} tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5 chmod +x ./premake5
- name: Download libevent
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.libevent.outputs.filepath }}
mv libevent-2.1.12-stable event
- name: Configure libevent
if: matrix.dynamic-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.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.13.3 freetype
- name: Download lua - name: Download lua
id: lua id: lua
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
...@@ -294,6 +338,19 @@ jobs: ...@@ -294,6 +338,19 @@ jobs:
tar xf ${{ steps.lua.outputs.filepath }} tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.7 lua mv lua-5.4.7 lua
- name: Download sqlite
if: matrix.dynamic-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.dynamic-link != true
run: |
7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3490100 sqlite3
- name: Download miniaudio - name: Download miniaudio
run: | run: |
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
...@@ -301,6 +358,65 @@ jobs: ...@@ -301,6 +358,65 @@ jobs:
cp extras/miniaudio_split/miniaudio.* . cp extras/miniaudio_split/miniaudio.* .
cd .. cd ..
- name: Download ogg
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.5 miniaudio/external/ogg
- name: Configure ogg
if: matrix.dynamic-link != true
run: |
cd miniaudio/external/ogg
./configure
cd ../../..
- name: Download opus
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus
- name: Download opusfile
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile
- name: Download vorbis
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis
- name: Download irrlicht - name: Download irrlicht
run: | run: |
git clone --depth=1 https://github.com/mercury233/irrlicht git clone --depth=1 https://github.com/mercury233/irrlicht
...@@ -310,22 +426,38 @@ jobs: ...@@ -310,22 +426,38 @@ jobs:
cp -r premake/* . cp -r premake/* .
cp -r resource/* . cp -r resource/* .
- name: Use premake to generate make files - name: Use premake to generate make files (apt packages)
if: matrix.dynamic-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
if: matrix.dynamic-link != true
run: |
./premake5 gmake
- name: Make - name: Make
run: | run: |
cd build cd build
make -j 4 config=release make -j 4 config=release
cd .. cd ..
- name: Strip symbols
run: |
cd bin/release
strip YGOPro
cd ../..
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: YGOPro-${{ matrix.os }} name: YGOPro-${{ matrix.name }}
path: | path: |
bin/release/YGOPro bin/release/YGOPro
...@@ -333,14 +465,43 @@ jobs: ...@@ -333,14 +465,43 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: name:
- macos-13 - macos-13-intel
- macos-15 - macos-13-arm-crossbuild
- macos-13-universal
- macos-15-arm
- macos-15-intel-crossbuild
- macos-15-universal
- macos-dynamic-link
include: include:
- os: macos-13 - name: macos-13-intel
premake_version: 5.0.0-beta5 os: macos-13
- os: macos-15 premake-version: 5.0.0-beta6
premake_version: 5.0.0-beta5 - name: macos-13-arm-crossbuild
os: macos-13
premake-version: 5.0.0-beta6
cross-build-arm: true
- name: macos-13-universal
os: macos-13
premake-version: 5.0.0-beta6
cross-build-intel: true
cross-build-arm: true
- name: macos-15-arm
os: macos-15
premake-version: 5.0.0-beta6
- name: macos-15-intel-crossbuild
os: macos-15
premake-version: 5.0.0-beta6
cross-build-intel: true
- name: macos-15-universal
os: macos-15
premake-version: 5.0.0-beta6
cross-build-intel: true
cross-build-arm: true
- name: macos-dynamic-link
os: macos-13
premake-version: 5.0.0-beta6
dynamic-link: true
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
...@@ -363,21 +524,60 @@ jobs: ...@@ -363,21 +524,60 @@ jobs:
# cd .. # cd ..
- name: Install dependencies - name: Install dependencies
if: matrix.dynamic-link == true
run: | run: |
brew install freetype libevent libx11 sqlite opus opusfile libvorbis brew install premake opus opusfile libvorbis
# brew install sqlite libx11 freetype libevent
- name: Download premake - name: Download premake
if: matrix.dynamic-link != true
id: premake id: premake
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
with: with:
url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake_version }}/premake-${{ matrix.premake_version }}-macosx.tar.gz url: https://github.com/premake/premake-core/releases/download/v${{ matrix.premake-version }}/premake-${{ matrix.premake-version }}-macosx.tar.gz
filename: premake5.tar.gz filename: premake5.tar.gz
- name: Extract premake - name: Extract premake
if: matrix.dynamic-link != true
run: | run: |
tar xf ${{ steps.premake.outputs.filepath }} tar xf ${{ steps.premake.outputs.filepath }}
chmod +x ./premake5 chmod +x ./premake5
- name: Download libevent
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.libevent.outputs.filepath }}
mv libevent-2.1.12-stable event
- name: Configure libevent
if: matrix.dynamic-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.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.freetype.outputs.filepath }}
mv freetype-2.13.3 freetype
- name: Download lua - name: Download lua
id: lua id: lua
uses: mercury233/action-cache-download-file@v1.0.0 uses: mercury233/action-cache-download-file@v1.0.0
...@@ -389,6 +589,19 @@ jobs: ...@@ -389,6 +589,19 @@ jobs:
tar xf ${{ steps.lua.outputs.filepath }} tar xf ${{ steps.lua.outputs.filepath }}
mv lua-5.4.7 lua mv lua-5.4.7 lua
- name: Download sqlite
if: matrix.dynamic-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.dynamic-link != true
run: |
7z x ${{ steps.sqlite.outputs.filepath }}
mv sqlite-amalgamation-3490100 sqlite3
- name: Download miniaudio - name: Download miniaudio
run: | run: |
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
...@@ -396,6 +609,58 @@ jobs: ...@@ -396,6 +609,58 @@ jobs:
cp extras/miniaudio_split/miniaudio.* . cp extras/miniaudio_split/miniaudio.* .
cd .. cd ..
- name: Download ogg
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.ogg.outputs.filepath }}
mv libogg-1.3.5 miniaudio/external/ogg
- name: Download opus
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.opus.outputs.filepath }}
mv opus-1.5.2 miniaudio/external/opus
- name: Download opusfile
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.opusfile.outputs.filepath }}
mv opusfile-0.12 miniaudio/external/opusfile
- name: Download vorbis
if: matrix.dynamic-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.dynamic-link != true
run: |
tar xf ${{ steps.vorbis.outputs.filepath }}
mv libvorbis-1.3.7 miniaudio/external/vorbis
- name: Download irrlicht - name: Download irrlicht
run: | run: |
git clone --depth=1 https://github.com/mercury233/irrlicht git clone --depth=1 https://github.com/mercury233/irrlicht
...@@ -405,31 +670,21 @@ jobs: ...@@ -405,31 +670,21 @@ jobs:
cp -r premake/* . cp -r premake/* .
cp -r resource/* . cp -r resource/* .
- name: Use premake to generate make files (Intel) - name: Use premake to generate make files (homebrew packages)
if: runner.arch == 'X64' if: matrix.dynamic-link == true
run: | run: |
./premake5 gmake \ premake5 gmake \
--cc=clang \ --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 (ARM64) - name: Use premake to generate make files
if: runner.arch == 'ARM64' if: matrix.dynamic-link != true
run: | run: |
./premake5 gmake \ ./premake5 gmake ${{ matrix.cross-build-intel == true && '--mac-intel' || '' }} ${{ matrix.cross-build-arm == true && '--mac-arm' || '' }}
--cc=clang \
--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" \
--miniaudio-include-dir="/opt/homebrew/include" \
--miniaudio-lib-dir="/opt/homebrew/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: Make - name: Make
run: | run: |
...@@ -440,6 +695,6 @@ jobs: ...@@ -440,6 +695,6 @@ jobs:
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: YGOPro-${{ matrix.os }} name: YGOPro-${{ matrix.name }}
path: | path: |
bin/* bin/release/YGOPro.app
...@@ -87,9 +87,11 @@ project "YGOPro" ...@@ -87,9 +87,11 @@ project "YGOPro"
links { "z" } links { "z" }
defines { "GL_SILENCE_DEPRECATION" } defines { "GL_SILENCE_DEPRECATION" }
if MAC_ARM then if MAC_ARM then
buildoptions { "--target=arm64-apple-macos12" }
linkoptions { "-arch arm64" } linkoptions { "-arch arm64" }
end end
if MAC_INTEL then
linkoptions { "-arch x86_64" }
end
if USE_AUDIO and AUDIO_LIB == "irrklang" then if USE_AUDIO and AUDIO_LIB == "irrklang" then
links { "irrklang" } links { "irrklang" }
end end
......
...@@ -33,12 +33,6 @@ project "miniaudio" ...@@ -33,12 +33,6 @@ project "miniaudio"
"external/opus/celt/rate.c", "external/opus/celt/rate.c",
"external/opus/celt/vq.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.c",
"external/opus/silk/bwexpander_32.c", "external/opus/silk/bwexpander_32.c",
"external/opus/silk/CNG.c", "external/opus/silk/CNG.c",
...@@ -118,10 +112,25 @@ project "miniaudio" ...@@ -118,10 +112,25 @@ project "miniaudio"
"external/vorbis/include", "external/vorbis/include",
} }
defines { defines {
"OPUS_BUILD", "USE_ALLOCA", "HAVE_LRINTF", "OP_HAVE_LRINTF", "OPUS_BUILD",
"OPUS_X86_PRESUME_SSE", "OPUS_X86_PRESUME_SSE2", "USE_ALLOCA",
"OPUS_HAVE_RTCD", "OPUS_X86_MAY_HAVE_SSE", "OPUS_X86_MAY_HAVE_SSE4_1", "OPUS_X86_MAY_HAVE_AVX2", "HAVE_LRINTF",
"OP_HAVE_LRINTF",
} }
if not TARGET_MAC_ARM 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 else
includedirs { OPUS_INCLUDE_DIR, VORBIS_INCLUDE_DIR, OGG_INCLUDE_DIR } includedirs { OPUS_INCLUDE_DIR, VORBIS_INCLUDE_DIR, OGG_INCLUDE_DIR }
end end
......
...@@ -3,15 +3,18 @@ ...@@ -3,15 +3,18 @@
BUILD_LUA = true BUILD_LUA = true
LUA_LIB_NAME = "lua" LUA_LIB_NAME = "lua"
BUILD_EVENT = os.istarget("windows") BUILD_EVENT = true
BUILD_FREETYPE = os.istarget("windows") BUILD_FREETYPE = true
BUILD_SQLITE = os.istarget("windows") BUILD_SQLITE = true
BUILD_IRRLICHT = true BUILD_IRRLICHT = true
USE_AUDIO = true USE_AUDIO = true
AUDIO_LIB = "miniaudio" AUDIO_LIB = "miniaudio"
-- BUILD_MINIAUDIO is always true
MINIAUDIO_SUPPORT_OPUS_VORBIS = true MINIAUDIO_SUPPORT_OPUS_VORBIS = true
MINIAUDIO_BUILD_OPUS_VORBIS = os.istarget("windows") MINIAUDIO_BUILD_OPUS_VORBIS = true
-- 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
...@@ -71,7 +74,8 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan ...@@ -71,7 +74,8 @@ newoption { trigger = "irrklang-pro-debug-lib-dir", category = "YGOPro - irrklan
newoption { trigger = 'build-ikpmp3', category = "YGOPro - irrklang - ikpmp3", description = "" } newoption { trigger = 'build-ikpmp3', category = "YGOPro - irrklang - ikpmp3", description = "" }
newoption { trigger = "winxp-support", category = "YGOPro", 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" }
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,"-","_")))
...@@ -202,8 +206,26 @@ end ...@@ -202,8 +206,26 @@ end
if GetParam("winxp-support") and os.istarget("windows") then if GetParam("winxp-support") and os.istarget("windows") then
WINXP_SUPPORT = true WINXP_SUPPORT = true
end end
if GetParam("mac-arm") and os.istarget("macosx") then
MAC_ARM = true 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
local uname = os.outputof("uname -m")
local proctranslated = os.outputof("sysctl sysctl.proc_translated")
if uname:find("arm") or proctranslated then
print("Detected Apple Silicon Mac")
TARGET_MAC_ARM = true
end
end
end end
workspace "YGOPro" workspace "YGOPro"
...@@ -227,7 +249,13 @@ workspace "YGOPro" ...@@ -227,7 +249,13 @@ workspace "YGOPro"
filter "system:macosx" filter "system:macosx"
libdirs { "/usr/local/lib" } libdirs { "/usr/local/lib" }
if MAC_ARM then 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 end
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" } links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
...@@ -255,9 +283,6 @@ workspace "YGOPro" ...@@ -255,9 +283,6 @@ workspace "YGOPro"
filter { "configurations:Release", "not action:vs*" } filter { "configurations:Release", "not action:vs*" }
symbols "On" symbols "On"
defines "NDEBUG" defines "NDEBUG"
if not MAC_ARM then
buildoptions "-march=native"
end
filter { "configurations:Debug", "action:vs*" } filter { "configurations:Debug", "action:vs*" }
disablewarnings { "6011", "6031", "6054", "6262" } disablewarnings { "6011", "6031", "6054", "6262" }
...@@ -273,6 +298,9 @@ workspace "YGOPro" ...@@ -273,6 +298,9 @@ workspace "YGOPro"
filter "not action:vs*" filter "not action:vs*"
buildoptions { "-fno-strict-aliasing", "-Wno-multichar", "-Wno-format-security" } buildoptions { "-fno-strict-aliasing", "-Wno-multichar", "-Wno-format-security" }
if not MAC_ARM and not MAC_INTEL then
buildoptions "-march=native"
end
filter {} 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