diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 4dce2198f..c58a72b54 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -1,234 +1,234 @@ -name: C/C++ CI - -on: [push, pull_request] - -jobs: - format-check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Format check - run: .github/format-check.sh - - build: - needs: [format-check] - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - config: [Release] - version: [zip, appimage] - include: - - os: ubuntu-latest - version: appimage - cache_path: ~/.ccache - extra_cmake_args: -DLINUXDEPLOY_COMMAND=/usr/local/bin/linuxdeploy-x86_64.AppImage - cmake_preset: linux-ninja-clang15-appimage - - os: ubuntu-latest - version: zip - cache_path: ~/.ccache - extra_cmake_args: - cmake_preset: linux-ninja-clang15 - - os: windows-latest - version: zip - cache_path: | - C:\vcpkg\installed - C:\vcpkg\packages - C:\Users\runneradmin\AppData\Local\ccache - extra_cmake_args: -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static-md - cmake_preset: windows-ninja - - os: macos-latest - version: zip - cache_path: ~/Library/Caches/ccache - extra_cmake_args: -DCMAKE_OSX_ARCHITECTURES="x86_64" - cmake_preset: macos-ninja - exclude: - - os: macos-latest - version: appimage - - os: windows-latest - version: appimage - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - name: Set up build environment (macos-latest) - run: | - brew install ccache ninja create-dmg - brew fetch --force --bottle-tag=x86_64_monterey boost openssl@3 molten-vk - brew install $(brew --cache --bottle-tag=x86_64_monterey boost) - brew install $(brew --cache --bottle-tag=x86_64_monterey molten-vk) - brew reinstall $(brew --cache --bottle-tag=x86_64_monterey openssl@3) - echo "$(brew --prefix ccache)/libexec" >> $GITHUB_PATH - ccache --set-config=compiler_check=content - if: matrix.os == 'macos-latest' - - - name: Set up build environment (ubuntu-latest) - run: | - sudo add-apt-repository -y ppa:mhier/libboost-latest - sudo add-apt-repository universe - sudo apt update - sudo apt -y install ccache libboost-filesystem1.83-dev libboost-program-options1.83-dev libboost-system1.83-dev libgtk-3-dev libsdl2-dev ninja-build libfuse2 - if: matrix.os == 'ubuntu-latest' - - - uses: ilammy/msvc-dev-cmd@v1 - if: matrix.os == 'windows-latest' - - - uses: actions/cache@v4 - with: - path: ${{ matrix.cache_path }} - key: cache-${{ matrix.os }}-${{ matrix.config }}-${{ github.sha }} - restore-keys: | - cache-${{ matrix.os }}-${{ matrix.config }}- - - - name: Set up build environment (windows-latest) - run: | - vcpkg install zlib:x64-windows-static-md boost-system:x64-windows-static-md boost-filesystem:x64-windows-static-md boost-program-options:x64-windows-static-md boost-icl:x64-windows-static-md boost-variant:x64-windows-static-md curl:x64-windows-static-md openssl:x64-windows-static-md - choco install ccache - if: matrix.os == 'windows-latest' - - - name: Set up SDL 2.28.3 (ubuntu-latest) - run: | - SDL2VER=2.28.3 - if [[ ! -e ~/.ccache ]]; then - mkdir ~/.ccache - fi - cd ~/.ccache - if [[ ! -e SDL2-${SDL2VER} ]]; then - curl -sLO https://libsdl.org/release/SDL2-${SDL2VER}.tar.gz - tar -xzf SDL2-${SDL2VER}.tar.gz - cd SDL2-${SDL2VER} - ./configure --prefix=/usr/local - make && cd ../ - rm SDL2-${SDL2VER}.tar.gz - fi - sudo make -C SDL2-${SDL2VER} install - if: matrix.os == 'ubuntu-latest' - - - name: Set up linuxdeploy (ubuntu-latest, appimage) - run: | - if [[ ! -e linuxdeploy-x86_64.AppImage ]]; then - curl -sLO https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-x86_64.AppImage - fi - sudo cp -f linuxdeploy-x86_64.AppImage /usr/local/bin/ - sudo chmod +x /usr/local/bin/linuxdeploy-x86_64.AppImage - if: matrix.os == 'ubuntu-latest' && matrix.version == 'appimage' - - - name: Ccache setup - run: ccache -z - - - name: CMake - run: | - cmake ${{ matrix.extra_cmake_args }} --preset ${{ matrix.cmake_preset }} - cmake --build build/${{ matrix.cmake_preset }} --config ${{ matrix.config }} - - - name: CTest - working-directory: build/${{ matrix.cmake_preset }} - run: ctest --build-config ${{ matrix.config }} --output-on-failure - - - name: Compute git short sha - shell: bash - run: echo "git_short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - - name: Set Build Variable - shell: bash - run: echo "build_variable=$(git rev-list HEAD --count)" >> $GITHUB_ENV - if: matrix.os == 'ubuntu-latest' - - - name: Bundle Shared Objects - id: bundle_shared_objects - run: | - cd build/${{ matrix.cmake_preset }}/bin/${{ matrix.config }} - cp /usr/lib/x86_64-linux-gnu/libssl.so.3 ./libssl.so.3 - cp /usr/lib/x86_64-linux-gnu/libcrypto.so.3 ./libcrypto.so.3 - if: matrix.os == 'ubuntu-latest' - - - name: Ccache statistics - run: ccache -s - - - name: Create DMG (macos-latest) - run: | - cd build/${{ matrix.cmake_preset }}/bin/${{ matrix.config }} - create-dmg \ - --volname "Vita3K Installer" \ - --volicon Vita3K.app/Contents/Resources/Vita3K.icns \ - --window-size 500 300 \ - --icon-size 100 \ - --icon Vita3K.app 120 115 \ - --app-drop-link 360 115 \ - vita3k-${{ env.git_short_sha }}-${{ matrix.version }}-${{ matrix.os }}.dmg \ - Vita3K.app - rm -rf Vita3K.app - if: matrix.os == 'macos-latest' - - - name: Clean appimage build (ubuntu-latest, appimage) - run: | - cd build/${{ matrix.cmake_preset }}/bin/${{ matrix.config }} - cp -f *AppImage* ../ - rm -rf ./* - cp -f ../*AppImage* ./ - rm -f ../*AppImage* - if: matrix.os == 'ubuntu-latest' && matrix.version == 'appimage' - - - uses: actions/upload-artifact@v4 - with: - name: vita3k-${{ env.git_short_sha }}-${{ matrix.version }}-${{ matrix.os }} - # path is set up to be /bin/ since that's how multi-config - # generators work on CMake - path: build/${{ matrix.cmake_preset }}/bin/${{ matrix.config }} - - outputs: - BuildTag: ${{ env.build_variable }} - - create-release: - needs: [build] - runs-on: "ubuntu-20.04" - if: github.ref == 'refs/heads/master' - steps: - - uses: actions/checkout@v4 - - - name: Download Artifacts - uses: actions/download-artifact@v4 - - - name: Get Build Variable - run: echo "Build_Variable=${{ needs.build.outputs.BuildTag }}" >> $GITHUB_ENV - - - name: Upload - shell: bash - run: | - mkdir artifacts/ - files=$(find . -name "*latest") - for f in $files; do - if [[ $f == *macos-latest ]] - then - cp $(basename $f)/$(basename $f).dmg artifacts/macos-latest.dmg - else - if [[ $f == *ubuntu-latest ]] - then - if [[ $f == *appimage* ]] - then - cp $(basename $f)/*.AppImage* artifacts/ - else - rm -f $(basename $f)/*.AppImage* - echo "Compressing $f" - (cd $(basename $f) && zip -r ../artifacts/$(basename $f | cut -d "-" -f 4)-latest.zip *) - fi - else - echo "Compressing $f" - (cd $(basename $f) && zip -r ../artifacts/$(basename $f | cut -d "-" -f 4)-latest.zip *) - fi - fi - done - ls -al artifacts/ - wget -c https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz - tar xfv ghr_v0.14.0_linux_amd64.tar.gz - ghr_v0.14.0_linux_amd64/ghr -u Vita3K -r Vita3K -recreate -n 'Automatic CI builds' -b "$(printf "Corresponding commit: ${{ github.sha }}\nVita3K Build: ${{ env.Build_Variable }}")" continuous artifacts/ - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +#name: C/C++ CI +# +#on: [push, pull_request] +# +#jobs: +# format-check: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Format check +# run: .github/format-check.sh +# +# build: +# needs: [format-check] +# runs-on: ${{ matrix.os }} +# +# strategy: +# fail-fast: false +# matrix: +# os: [ubuntu-latest, windows-latest, macos-latest] +# config: [Release] +# version: [zip, appimage] +# include: +# - os: ubuntu-latest +# version: appimage +# cache_path: ~/.ccache +# extra_cmake_args: -DLINUXDEPLOY_COMMAND=/usr/local/bin/linuxdeploy-x86_64.AppImage +# cmake_preset: linux-ninja-clang15-appimage +# - os: ubuntu-latest +# version: zip +# cache_path: ~/.ccache +# extra_cmake_args: +# cmake_preset: linux-ninja-clang15 +# - os: windows-latest +# version: zip +# cache_path: | +# C:\vcpkg\installed +# C:\vcpkg\packages +# C:\Users\runneradmin\AppData\Local\ccache +# extra_cmake_args: -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static-md +# cmake_preset: windows-ninja +# - os: macos-latest +# version: zip +# cache_path: ~/Library/Caches/ccache +# extra_cmake_args: -DCMAKE_OSX_ARCHITECTURES="x86_64" +# cmake_preset: macos-ninja +# exclude: +# - os: macos-latest +# version: appimage +# - os: windows-latest +# version: appimage +# +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: recursive +# +# - name: Set up build environment (macos-latest) +# run: | +# brew install ccache ninja create-dmg +# brew fetch --force --bottle-tag=x86_64_monterey boost openssl@3 molten-vk +# brew install $(brew --cache --bottle-tag=x86_64_monterey boost) +# brew install $(brew --cache --bottle-tag=x86_64_monterey molten-vk) +# brew reinstall $(brew --cache --bottle-tag=x86_64_monterey openssl@3) +# echo "$(brew --prefix ccache)/libexec" >> $GITHUB_PATH +# ccache --set-config=compiler_check=content +# if: matrix.os == 'macos-latest' +# +# - name: Set up build environment (ubuntu-latest) +# run: | +# sudo add-apt-repository -y ppa:mhier/libboost-latest +# sudo add-apt-repository universe +# sudo apt update +# sudo apt -y install ccache libboost-filesystem1.83-dev libboost-program-options1.83-dev libboost-system1.83-dev libgtk-3-dev libsdl2-dev ninja-build libfuse2 +# if: matrix.os == 'ubuntu-latest' +# +# - uses: ilammy/msvc-dev-cmd@v1 +# if: matrix.os == 'windows-latest' +# +# - uses: actions/cache@v4 +# with: +# path: ${{ matrix.cache_path }} +# key: cache-${{ matrix.os }}-${{ matrix.config }}-${{ github.sha }} +# restore-keys: | +# cache-${{ matrix.os }}-${{ matrix.config }}- +# +# - name: Set up build environment (windows-latest) +# run: | +# vcpkg install zlib:x64-windows-static-md boost-system:x64-windows-static-md boost-filesystem:x64-windows-static-md boost-program-options:x64-windows-static-md boost-icl:x64-windows-static-md boost-variant:x64-windows-static-md curl:x64-windows-static-md openssl:x64-windows-static-md +# choco install ccache +# if: matrix.os == 'windows-latest' +# +# - name: Set up SDL 2.28.3 (ubuntu-latest) +# run: | +# SDL2VER=2.28.3 +# if [[ ! -e ~/.ccache ]]; then +# mkdir ~/.ccache +# fi +# cd ~/.ccache +# if [[ ! -e SDL2-${SDL2VER} ]]; then +# curl -sLO https://libsdl.org/release/SDL2-${SDL2VER}.tar.gz +# tar -xzf SDL2-${SDL2VER}.tar.gz +# cd SDL2-${SDL2VER} +# ./configure --prefix=/usr/local +# make && cd ../ +# rm SDL2-${SDL2VER}.tar.gz +# fi +# sudo make -C SDL2-${SDL2VER} install +# if: matrix.os == 'ubuntu-latest' +# +# - name: Set up linuxdeploy (ubuntu-latest, appimage) +# run: | +# if [[ ! -e linuxdeploy-x86_64.AppImage ]]; then +# curl -sLO https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-x86_64.AppImage +# fi +# sudo cp -f linuxdeploy-x86_64.AppImage /usr/local/bin/ +# sudo chmod +x /usr/local/bin/linuxdeploy-x86_64.AppImage +# if: matrix.os == 'ubuntu-latest' && matrix.version == 'appimage' +# +# - name: Ccache setup +# run: ccache -z +# +# - name: CMake +# run: | +# cmake ${{ matrix.extra_cmake_args }} --preset ${{ matrix.cmake_preset }} +# cmake --build build/${{ matrix.cmake_preset }} --config ${{ matrix.config }} +# +# - name: CTest +# working-directory: build/${{ matrix.cmake_preset }} +# run: ctest --build-config ${{ matrix.config }} --output-on-failure +# +# - name: Compute git short sha +# shell: bash +# run: echo "git_short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV +# +# - name: Set Build Variable +# shell: bash +# run: echo "build_variable=$(git rev-list HEAD --count)" >> $GITHUB_ENV +# if: matrix.os == 'ubuntu-latest' +# +# - name: Bundle Shared Objects +# id: bundle_shared_objects +# run: | +# cd build/${{ matrix.cmake_preset }}/bin/${{ matrix.config }} +# cp /usr/lib/x86_64-linux-gnu/libssl.so.3 ./libssl.so.3 +# cp /usr/lib/x86_64-linux-gnu/libcrypto.so.3 ./libcrypto.so.3 +# if: matrix.os == 'ubuntu-latest' +# +# - name: Ccache statistics +# run: ccache -s +# +# - name: Create DMG (macos-latest) +# run: | +# cd build/${{ matrix.cmake_preset }}/bin/${{ matrix.config }} +# create-dmg \ +# --volname "Vita3K Installer" \ +# --volicon Vita3K.app/Contents/Resources/Vita3K.icns \ +# --window-size 500 300 \ +# --icon-size 100 \ +# --icon Vita3K.app 120 115 \ +# --app-drop-link 360 115 \ +# vita3k-${{ env.git_short_sha }}-${{ matrix.version }}-${{ matrix.os }}.dmg \ +# Vita3K.app +# rm -rf Vita3K.app +# if: matrix.os == 'macos-latest' +# +# - name: Clean appimage build (ubuntu-latest, appimage) +# run: | +# cd build/${{ matrix.cmake_preset }}/bin/${{ matrix.config }} +# cp -f *AppImage* ../ +# rm -rf ./* +# cp -f ../*AppImage* ./ +# rm -f ../*AppImage* +# if: matrix.os == 'ubuntu-latest' && matrix.version == 'appimage' +# +# - uses: actions/upload-artifact@v4 +# with: +# name: vita3k-${{ env.git_short_sha }}-${{ matrix.version }}-${{ matrix.os }} +# # path is set up to be /bin/ since that's how multi-config +# # generators work on CMake +# path: build/${{ matrix.cmake_preset }}/bin/${{ matrix.config }} +# +# outputs: +# BuildTag: ${{ env.build_variable }} +# +# create-release: +# needs: [build] +# runs-on: "ubuntu-20.04" +# if: github.ref == 'refs/heads/master' +# steps: +# - uses: actions/checkout@v4 +# +# - name: Download Artifacts +# uses: actions/download-artifact@v4 +# +# - name: Get Build Variable +# run: echo "Build_Variable=${{ needs.build.outputs.BuildTag }}" >> $GITHUB_ENV +# +# - name: Upload +# shell: bash +# run: | +# mkdir artifacts/ +# files=$(find . -name "*latest") +# for f in $files; do +# if [[ $f == *macos-latest ]] +# then +# cp $(basename $f)/$(basename $f).dmg artifacts/macos-latest.dmg +# else +# if [[ $f == *ubuntu-latest ]] +# then +# if [[ $f == *appimage* ]] +# then +# cp $(basename $f)/*.AppImage* artifacts/ +# else +# rm -f $(basename $f)/*.AppImage* +# echo "Compressing $f" +# (cd $(basename $f) && zip -r ../artifacts/$(basename $f | cut -d "-" -f 4)-latest.zip *) +# fi +# else +# echo "Compressing $f" +# (cd $(basename $f) && zip -r ../artifacts/$(basename $f | cut -d "-" -f 4)-latest.zip *) +# fi +# fi +# done +# ls -al artifacts/ +# wget -c https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz +# tar xfv ghr_v0.14.0_linux_amd64.tar.gz +# ghr_v0.14.0_linux_amd64/ghr -u Vita3K -r Vita3K -recreate -n 'Automatic CI builds' -b "$(printf "Corresponding commit: ${{ github.sha }}\nVita3K Build: ${{ env.Build_Variable }}")" continuous artifacts/ +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/android/build.gradle b/android/build.gradle index 246a582ec..25ee904de 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -4,14 +4,16 @@ android { namespace "org.vita3k.emulator" compileSdk 34 ndkVersion "26.3.11579264" - buildToolsVersion "34.0.0" + buildFeatures { + buildConfig true + } defaultConfig { applicationId "org.vita3k.emulator" minSdk 24 targetSdk 34 - versionCode 11 - versionName "0.2.0-11" + versionCode 12 + versionName "0.2.0-12" externalNativeBuild { cmake { diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 71f3a4fe5..cc2c7cf41 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -45,9 +45,16 @@ + + android:maxSdkVersion="29" /> + + @@ -70,6 +77,8 @@ then replace "SDLActivity" with the name of your class (e.g. "MyGame") in the XML below. An example Java class can be found in README-android.md + + The requestLegacyExternalStorage parameter only has an effect when running on Android <= 10 --> + android:hasFragileUserData="true" + android:requestLegacyExternalStorage="true" + tools:targetApi="q">