From fdfab70bd0883d0d9b555853cd3ad812f3424c8c Mon Sep 17 00:00:00 2001 From: dcvz Date: Mon, 3 Jun 2024 11:12:39 +0200 Subject: [PATCH] More fixes --- .github/linux/appimage.sh | 4 ++-- .github/workflows/validate.yml | 6 +++--- CMakeLists.txt | 17 ++++++++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/linux/appimage.sh b/.github/linux/appimage.sh index 3d706ba..03c3cc5 100755 --- a/.github/linux/appimage.sh +++ b/.github/linux/appimage.sh @@ -1,10 +1,10 @@ ARCH=$(uname -m) LINUX_DEPLOY_ARCH=$(uname -m) -if [ "$ARCH" == "x86_64" ]; then +if [ "$ARCH" = "x86_64" ]; then ARCH="x86_64" LINUX_DEPLOY_ARCH="x86_64" -elif [ "$ARCH" == "aarch64" ]; then +elif [ "$ARCH" = "aarch64" ]; then ARCH="arm_aarch64" LINUX_DEPLOY_ARCH="aarch64" else diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c2b849b..db6ae02 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -29,7 +29,7 @@ jobs: key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-x64 - name: Prepare Build run: |- - apt-get install -y unzip llvm-17 llvm-17-tools lld-17 + apt-get install -y unzip llvm-17 llvm-17-tools lld-17 curl git clone ${{ secrets.ZRE_REPO_WITH_PAT }} unzip zre/files.zip > /dev/null 2>&1 - name: Run N64Recomp & RSPRecomp @@ -53,14 +53,14 @@ jobs: rm -rf assets/scss tar -czf Zelda64Recompiled.tar.gz Zelda64Recompiled assets/ - name: Archive Zelda64Recomp - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: Zelda64Recompiled-${{ runner.os }}-${{ runner.arch }}-${{ matrix.type }} path: Zelda64Recompiled.tar.gz - name: Prepare AppImage run: ./.github/linux/appimage.sh - name: Zelda64Recomp AppImage - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: Zelda64Recompiled-AppImage-${{ runner.arch }}-${{ matrix.type }} path: Zelda64Recompiled-*.AppImage diff --git a/CMakeLists.txt b/CMakeLists.txt index f8fa975..9051944 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,10 +75,25 @@ target_sources(PatchesLib PRIVATE set_source_files_properties(${CMAKE_SOURCE_DIR}/RecompiledPatches/patches.c PROPERTIES COMPILE_FLAGS -fno-strict-aliasing) # Build patches elf +set(PATCHES_COMMAND "") + +if(DEFINED PATCHES_C_COMPILER) + set(PATCHES_COMMAND "${PATCHES_COMMAND} CC=${PATCHES_C_COMPILER}") +endif() + +if(DEFINED PATCHES_LD) + set(PATCHES_COMMAND "${PATCHES_COMMAND} LD=${PATCHES_LD}") +endif() + +if(DEFINED PATCHES_OBJCOPY) + set(PATCHES_COMMAND "${PATCHES_COMMAND} OBJCOPY=${PATCHES_OBJCOPY}") +endif() + add_custom_target(PatchesBin - COMMAND CC=${PATCHES_C_COMPILER} LD=${PATCHES_LD} OBJCOPY=${PATCHES_OBJCOPY} make + COMMAND ${PATCHES_COMMAND} make WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/patches BYPRODUCTS ${CMAKE_SOURCE_DIR}/patches/patches.bin + VERBATIM ) # Generate patches_bin.c from patches.bin