Merge remote-tracking branch 'upstream/12.0-development' into 12.0-development

This commit is contained in:
niki
2022-10-25 13:52:35 +02:00
4 changed files with 106 additions and 42 deletions
+80 -30
View File
@@ -17,11 +17,12 @@ jobs:
libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \ libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \
libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev
- name: Checkout love-appimage-source - name: Checkout love-appimage-source
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
repository: MikuAuahDark/love-appimage-source repository: MikuAuahDark/love-appimage-source
ref: 12.x
- name: Checkout LÖVE - name: Checkout LÖVE
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
path: love2d-${{ github.sha }} path: love2d-${{ github.sha }}
- name: Build AppImage - name: Build AppImage
@@ -29,7 +30,7 @@ jobs:
- name: Print LuaJIT branch - name: Print LuaJIT branch
run: git -C LuaJIT-v2.1 branch -v run: git -C LuaJIT-v2.1 branch -v
- name: Artifact - name: Artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: love-linux-x86_64.AppImage name: love-linux-x86_64.AppImage
path: love-${{ github.sha }}.AppImage path: love-${{ github.sha }}.AppImage
@@ -37,47 +38,96 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
strategy: strategy:
matrix: matrix:
platform: [Win32, x64] platform: [Win32, x64, ARM64]
install: [compat, modern] install: [compat, modern]
include: exclude:
- platform: Win32 - platform: ARM64
arch: x86 install: compat
- platform: x64 defaults:
arch: x64 run:
upload_jitmodules: true shell: cmd
- install: compat continue-on-error: ${{ matrix.platform == 'ARM64' }}
compatdef: -DLOVE_INSTALL_UCRT=ON
compatname: -compat
steps: steps:
- name: Define Variables
id: vars
run: |
rem Compat/Modern switch
if "${{ matrix.install }}" == "compat" (
echo moredef=-DLOVE_INSTALL_UCRT=ON>> "%GITHUB_OUTPUT%"
echo compatname=-compat>> "%GITHUB_OUTPUT%"
) else (
echo moredef=>> "%GITHUB_OUTPUT%"
echo compatname=>> "%GITHUB_OUTPUT%"
)
rem JIT Modules
if "${{ matrix.platform }}-${{ matrix.install }}" == "x64-modern" (
(echo jitmodules=1)>> "%GITHUB_OUTPUT%"
) else (
(echo jitmodules=0)>> "%GITHUB_OUTPUT%"
)
rem Architecture-Specific Switch
goto ${{ matrix.platform }}
exit /b 1
:Win32
(echo arch=x86)>> "%GITHUB_OUTPUT%"
(echo angle=0)>> "%GITHUB_OUTPUT%"
echo nofiles=warn>> "%GITHUB_OUTPUT%"
exit /b 0
:x64
(echo arch=x64)>> "%GITHUB_OUTPUT%"
(echo angle=0)>> "%GITHUB_OUTPUT%"
echo nofiles=warn>> "%GITHUB_OUTPUT%"
exit /b 0
:ARM64
(echo arch=arm64)>> "%GITHUB_OUTPUT%"
(echo angle=1)>> "%GITHUB_OUTPUT%"
echo nofiles=ignore>> "%GITHUB_OUTPUT%"
echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll>> "%GITHUB_OUTPUT%"
exit /b 0
- name: Clone Megasource - name: Clone Megasource
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
path: megasource path: megasource
repository: love2d/megasource repository: love2d/megasource
ref: 12.x ref: 12.x
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
path: megasource/libs/love path: megasource/libs/love
- name: Download ANGLE
uses: robinraju/release-downloader@v1.5
if: steps.vars.outputs.angle == '1'
with:
repository: MikuAuahDark/angle-winbuild
tag: cr_5249
fileName: angle-win-${{ steps.vars.outputs.arch }}.zip
tarBall: false
zipBall: false
out-file-path: angle
- name: Extract ANGLE
if: steps.vars.outputs.angle == '1'
working-directory: angle
run: 7z x angle-win-${{ steps.vars.outputs.arch }}.zip
- name: Configure - name: Configure
shell: cmd run: cmake -Bbuild -Hmegasource -T v142 -A ${{ matrix.platform }} -DCMAKE_INSTALL_PREFIX=%CD%\install ${{ steps.vars.outputs.moredef }}
env:
PLATFORM: ${{ matrix.platform }}
run: cmake -Bbuild -Hmegasource -T v142 -A %PLATFORM% ${{ matrix.compatdef }} -DCMAKE_INSTALL_PREFIX=%CD%\install
- name: Install - name: Install
shell: cmd
run: cmake --build build --target PACKAGE --config Release -j2 run: cmake --build build --target PACKAGE --config Release -j2
- name: Artifact - name: Artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: love-windows-${{ matrix.arch }}${{ matrix.compatname }} name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}
path: | path: |
build/*.zip build/*.zip
build/*.exe build/*.exe
if-no-files-found: ${{ steps.vars.outputs.nofiles }}
- name: Artifact JIT Modules - name: Artifact JIT Modules
if: matrix.upload_jitmodules if: steps.vars.outputs.jitmodules == '1'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: love-windows-jitmodules name: love-windows-jitmodules
path: build/libs/LuaJIT/src/jit/*.lua path: build/libs/LuaJIT/src/jit/*.lua
@@ -85,9 +135,9 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Clone Dependencies - name: Clone Dependencies
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
path: apple-dependencies path: apple-dependencies
repository: love2d/love-apple-dependencies repository: love2d/love-apple-dependencies
@@ -105,7 +155,7 @@ jobs:
run: run:
ditto -c -k --sequesterRsrc --keepParent love-macos/love.app love-macos.zip ditto -c -k --sequesterRsrc --keepParent love-macos/love.app love-macos.zip
- name: Artifact - name: Artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: love-macos name: love-macos
path: love-macos.zip path: love-macos.zip
@@ -113,9 +163,9 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Clone Dependencies - name: Clone Dependencies
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
path: apple-dependencies path: apple-dependencies
repository: love2d/love-apple-dependencies repository: love2d/love-apple-dependencies
+22 -8
View File
@@ -53,12 +53,15 @@ else()
set(LOVE_TARGET_PLATFORM x86) set(LOVE_TARGET_PLATFORM x86)
endif() endif()
if(APPLE)
option(LOVE_JIT "Use LuaJIT" FALSE) if(APPLE OR MEGA_ARM64)
set(LOVE_DEFAULT_JIT FALSE)
else() else()
option(LOVE_JIT "Use LuaJIT" TRUE) set(LOVE_DEFAULT_JIT TRUE)
endif() endif()
option(LOVE_JIT "Use LuaJIT" ${LOVE_DEFAULT_JIT})
if(LOVE_JIT) if(LOVE_JIT)
if(APPLE) if(APPLE)
message(WARNING "JIT not supported yet on Mac.") message(WARNING "JIT not supported yet on Mac.")
@@ -119,12 +122,16 @@ if(MEGA)
${MEGA_OPENAL} ${MEGA_OPENAL}
) )
# LOVE_EXTRA_DLLS are non-runtime DLLs which should be bundled with the
# love binary in installers, etc. It's only needed for external
# (non-CMake) targets, i.e. LuaJIT.
if(NOT DEFINED LOVE_EXTRA_DLLS)
set(LOVE_EXTRA_DLLS)
endif()
if(LOVE_JIT) if(LOVE_JIT)
set(LOVE_LUA_LIBRARY ${MEGA_LUAJIT_LIB}) set(LOVE_LUA_LIBRARY ${MEGA_LUAJIT_LIB})
# LOVE_EXTRA_DLLS are non-runtime DLLs which should be bundled with the set(LOVE_EXTRA_DLLS ${LOVE_EXTRA_DLLS} ${MEGA_LUAJIT_DLL})
# love binary in installers, etc. It's only needed for external
# (non-CMake) targets, i.e. LuaJIT.
set(LOVE_EXTRA_DLLS ${MEGA_LUAJIT_DLL})
set(LOVE_EXTRA_DEPENDECIES luajit) set(LOVE_EXTRA_DEPENDECIES luajit)
set(LOVE_INCLUDE_DIRS set(LOVE_INCLUDE_DIRS
@@ -1996,6 +2003,14 @@ message(STATUS "Version: ${LOVE_VERSION_STR}")
################################### ###################################
install(TARGETS ${LOVE_EXE_NAME} ${LOVE_CONSOLE_EXE_NAME} ${LOVE_LIB_NAME} RUNTIME DESTINATION .) install(TARGETS ${LOVE_EXE_NAME} ${LOVE_CONSOLE_EXE_NAME} ${LOVE_LIB_NAME} RUNTIME DESTINATION .)
# Our install script (and NSIS) doesn't fully support Windows ARM64 yet.
if(MEGA_ARM64)
set(CPACK_GENERATOR ZIP)
set(CPACK_SYSTEM_NAME woa64)
else()
set(CPACK_GENERATOR ZIP NSIS)
endif()
# Extra DLLs. # Extra DLLs.
if(LOVE_EXTRA_DLLS) if(LOVE_EXTRA_DLLS)
foreach(DLL ${LOVE_EXTRA_DLLS}) foreach(DLL ${LOVE_EXTRA_DLLS})
@@ -2038,7 +2053,6 @@ install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/game.ico ${CMAKE_CURRENT_SOURCE_DIR}/extra/nsis/game.ico
DESTINATION .) DESTINATION .)
set(CPACK_GENERATOR ZIP NSIS)
set(CPACK_PACKAGE_NAME "love") set(CPACK_PACKAGE_NAME "love")
set(CPACK_PACKAGE_VENDOR "love2d.org") set(CPACK_PACKAGE_VENDOR "love2d.org")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LOVE -- It's awesome") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LOVE -- It's awesome")
+2
View File
@@ -2335,6 +2335,8 @@ int w_getBackgroundColor(lua_State *L)
int w_setNewFont(lua_State *L) int w_setNewFont(lua_State *L)
{ {
luax_markdeprecated(L, 1, "love.graphics.setNewFont", API_FUNCTION, DEPRECATED_NO_REPLACEMENT, nullptr);
int ret = w_newFont(L); int ret = w_newFont(L);
Font *font = luax_checktype<Font>(L, -1); Font *font = luax_checktype<Font>(L, -1);
instance()->setFont(font); instance()->setFont(font);
+2 -4
View File
@@ -262,11 +262,9 @@ std::vector<Window::ContextAttribs> Window::getContextAttribsList() const
} }
} }
if (!preferGLES) const char *gleshint = SDL_GetHint("LOVE_GRAPHICS_USE_OPENGLES");
{ if (gleshint != nullptr)
const char *gleshint = SDL_GetHint("LOVE_GRAPHICS_USE_OPENGLES");
preferGLES = (gleshint != nullptr && gleshint[0] != '0'); preferGLES = (gleshint != nullptr && gleshint[0] != '0');
}
// Do we want a debug context? // Do we want a debug context?
bool debug = love::graphics::isDebugEnabled(); bool debug = love::graphics::isDebugEnabled();