From 4b0a98bbc314868a1057b303745831743e1d356c Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 09:13:21 +0100 Subject: [PATCH 01/23] Update README.md --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1621434..b091a91 100644 --- a/README.md +++ b/README.md @@ -251,8 +251,24 @@ The project requires CMake 3.20 or later and Clang 18 or later to build. Since t Compilers other than Clang have not been tested and are not recommended, including for recompilation output. The project relies on compiler-specific intrinsics and techniques that may not function correctly on other compilers, and many optimization methods depend on Clang's code generation. +### Linux + +**TODO** + +### Windows (Visual Studio) + On Windows, you can use the clang-cl toolset and open the project in Visual Studio's CMake integration. +### Windows (MSYS2) + +Alternatively, you can install [MSYS2](https://www.msys2.org/) and use the "MSYS2 CLANG64" environment to build the project. + +First, you need to install the necessary packages (`mingw-w64-clang-x86_64-cmake`, `mingw-w64-clang-x86_64-libc++` and `mingw-w64-x86_64-ninja`) with `pacman -S `. + +Then, you can head into the cloned repo's directory (you can access your C drive by going into the `/c` folder inside of MSYS2), and execute the command `cmake -DCMAKE_BUILD_TYPE=Debug .`, which will generate a `build.ninja` file for the project. + +Finally, run the `ninja` command, and you should end up with compiled executables. Attempting to launch them will tell you about a missing `libc++.dll` file, which you can copy to your current folder with the `cp /clang64/bin/libc++.dll .` command. + ## Special Thanks -This project could not have been possible without the [Xenia](https://github.com/xenia-project/xenia) emulator, as many parts of the CPU code conversion process has been implemented by heavily referencing its PPC code translator. The project also uses code from [Xenia Canary](https://github.com/xenia-canary/xenia-canary) to patch XEX binaries. \ No newline at end of file +This project could not have been possible without the [Xenia](https://github.com/xenia-project/xenia) emulator, as many parts of the CPU code conversion process has been implemented by heavily referencing its PPC code translator. The project also uses code from [Xenia Canary](https://github.com/xenia-canary/xenia-canary) to patch XEX binaries. From 7be7907a37db36ffe6d1a8ebf4a6834a66d175e1 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 09:33:13 +0100 Subject: [PATCH 02/23] Create cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/cmake-multi-platform.yml diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml new file mode 100644 index 0000000..668610d --- /dev/null +++ b/.github/workflows/cmake-multi-platform.yml @@ -0,0 +1,70 @@ +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +name: CMake on multiple platforms + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + + # Set up a matrix to run the following 3 configurations: + # 1. + # 2. + # + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + matrix: + os: [ubuntu-latest, windows-latest] + build_type: [Release] + c_compiler: [clang, cl] + include: + - os: windows-latest + c_compiler: cl + cpp_compiler: cl + - os: ubuntu-latest + c_compiler: clang + cpp_compiler: clang++ + exclude: + - os: windows-latest + c_compiler: clang + - os: ubuntu-latest + c_compiler: cl + + + steps: + - uses: actions/checkout@v4 + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config ${{ matrix.build_type }} From 16b659f755f3b6536f637660a37e261e9aa23409 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 09:40:07 +0100 Subject: [PATCH 03/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 668610d..3d37556 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -40,7 +40,10 @@ jobs: steps: - - uses: actions/checkout@v4 + - name: Checkout repository with submodules + uses: actions/checkout@v4 + with: + submodules: recursive - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From 4385b4ae8b380021b0b4b144e232b64b394c32df Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 09:49:48 +0100 Subject: [PATCH 04/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 3d37556..c184732 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -24,11 +24,11 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] build_type: [Release] - c_compiler: [clang, cl] + c_compiler: [clang, clang-cl] include: - os: windows-latest - c_compiler: cl - cpp_compiler: cl + c_compiler: clang-cl + cpp_compiler: clang-cl - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ @@ -36,7 +36,7 @@ jobs: - os: windows-latest c_compiler: clang - os: ubuntu-latest - c_compiler: cl + c_compiler: clang-cl steps: @@ -52,6 +52,22 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + - name: Set up Clang-Cl on Windows + if: runner.os == 'Windows' + shell: pwsh + run: | + echo "Setting up Clang-Cl..." + echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "Using Clang Version:" + clang-cl --version + + - name: Install Ninja on Windows + if: runner.os == 'Windows' + run: | + choco install ninja --no-progress + shell: pwsh + - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type From 72bbf9d008bc6b1a109c8eeead1cc277864e7e0c Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 10:00:35 +0100 Subject: [PATCH 05/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 38 ++++------------------ 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index c184732..9c77abb 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -1,5 +1,3 @@ -# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. -# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml name: CMake on multiple platforms on: @@ -13,14 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: - # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. fail-fast: false - - # Set up a matrix to run the following 3 configurations: - # 1. - # 2. - # - # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: os: [ubuntu-latest, windows-latest] build_type: [Release] @@ -33,24 +24,13 @@ jobs: c_compiler: clang cpp_compiler: clang++ exclude: - - os: windows-latest - c_compiler: clang - os: ubuntu-latest c_compiler: clang-cl - steps: - - name: Checkout repository with submodules - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: - submodules: recursive - - - name: Set reusable strings - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + submodules: recursive # Ensure submodules are cloned - name: Set up Clang-Cl on Windows if: runner.os == 'Windows' @@ -69,21 +49,17 @@ jobs: shell: pwsh - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + cmake -B ${{ github.workspace }}/build -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -G Ninja -S ${{ github.workspace }} - name: Build - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + working-directory: ${{ github.workspace }}/build run: ctest --build-config ${{ matrix.build_type }} From 1d7852d709212c32b6aa42b523961f5787464f48 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 10:05:32 +0100 Subject: [PATCH 06/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 9c77abb..8ac79de 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -2,9 +2,9 @@ name: CMake on multiple platforms on: push: - branches: [ "main" ] pull_request: - branches: [ "main" ] + workflow_dispatch: + jobs: build: From 73467700c9fbe2b77d8bcb1a14b0a8dd3b4ccc97 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 10:08:47 +0100 Subject: [PATCH 07/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 39 ++++++++-------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 8ac79de..b99cbb8 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -1,21 +1,16 @@ -name: CMake on multiple platforms +name: CMake with Clang and Ninja on: - push: - pull_request: workflow_dispatch: - jobs: build: runs-on: ${{ matrix.os }} - strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - build_type: [Release] - c_compiler: [clang, clang-cl] + build_type: [Release, Debug] include: - os: windows-latest c_compiler: clang-cl @@ -23,43 +18,35 @@ jobs: - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ - exclude: - - os: ubuntu-latest - c_compiler: clang-cl steps: - uses: actions/checkout@v4 - with: - submodules: recursive # Ensure submodules are cloned - - name: Set up Clang-Cl on Windows - if: runner.os == 'Windows' - shell: pwsh - run: | - echo "Setting up Clang-Cl..." - echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "Using Clang Version:" - clang-cl --version + - name: Install Ninja (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y ninja-build + shell: bash - - name: Install Ninja on Windows + - name: Install Ninja (Windows) if: runner.os == 'Windows' - run: | - choco install ninja --no-progress - shell: pwsh + run: choco install ninja + shell: powershell - name: Configure CMake run: > cmake -B ${{ github.workspace }}/build - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G Ninja -S ${{ github.workspace }} + shell: bash - name: Build run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} + shell: bash - name: Test working-directory: ${{ github.workspace }}/build run: ctest --build-config ${{ matrix.build_type }} + shell: bash From f08dc5b976744047a9944a907e85c236cf233e16 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 10:23:11 +0100 Subject: [PATCH 08/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index b99cbb8..5229ae6 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -1,8 +1,11 @@ name: CMake with Clang and Ninja on: + push: + pull_request: workflow_dispatch: + jobs: build: runs-on: ${{ matrix.os }} @@ -10,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - build_type: [Release, Debug] + build_type: [Debug] include: - os: windows-latest c_compiler: clang-cl From 223514cae9c56f9c4a9c584ee4d610f90b42c3a0 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 11:12:59 +0100 Subject: [PATCH 09/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 5229ae6..4861db0 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -24,6 +24,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + submodules: recursive - name: Install Ninja (Linux) if: runner.os == 'Linux' From 745f0715a5a3a8bf9a1b2d031c086a39a827cd8f Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 11:21:01 +0100 Subject: [PATCH 10/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 40 +++++++++++++++++----- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 4861db0..b6a3cb9 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -5,7 +5,6 @@ on: pull_request: workflow_dispatch: - jobs: build: runs-on: ${{ matrix.os }} @@ -37,21 +36,46 @@ jobs: run: choco install ninja shell: powershell - - name: Configure CMake + - name: Configure CMake (Linux) + if: runner.os == 'Linux' run: > - cmake -B ${{ github.workspace }}/build + cmake -B build -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G Ninja - -S ${{ github.workspace }} + -S . shell: bash - - name: Build - run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} + - name: Configure CMake (Windows) + if: runner.os == 'Windows' + run: > + cmake -B build + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -G Ninja + -S . + shell: powershell + + - name: Build (Linux) + if: runner.os == 'Linux' + run: cmake --build build --config ${{ matrix.build_type }} shell: bash - - name: Test - working-directory: ${{ github.workspace }}/build + - name: Build (Windows) + if: runner.os == 'Windows' + run: cmake --build build --config ${{ matrix.build_type }} + shell: powershell + + - name: Test (Linux) + if: runner.os == 'Linux' + working-directory: build run: ctest --build-config ${{ matrix.build_type }} shell: bash + + - name: Test (Windows) + if: runner.os == 'Windows' + working-directory: build + run: ctest --build-config ${{ matrix.build_type }} + shell: powershell From 979ae519ae6ea670c1ef0faba56007daffd699ed Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 11:32:36 +0100 Subject: [PATCH 11/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index b6a3cb9..c398e6d 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -68,14 +68,24 @@ jobs: run: cmake --build build --config ${{ matrix.build_type }} shell: powershell - - name: Test (Linux) + - name: Package Artifacts (Linux) if: runner.os == 'Linux' - working-directory: build - run: ctest --build-config ${{ matrix.build_type }} + run: | + mkdir -p artifacts + cp build/XenonRecompiler/XenonRecompiler artifacts/ + cp build/XenonAnalyse/XenonAnalyse artifacts/ shell: bash - - name: Test (Windows) + - name: Package Artifacts (Windows) if: runner.os == 'Windows' - working-directory: build - run: ctest --build-config ${{ matrix.build_type }} + run: | + New-Item -ItemType Directory -Path artifacts + Copy-Item -Path build\XenonRecompiler\XenonRecompiler.exe -Destination artifacts\ + Copy-Item -Path build\XenonAnalyse\XenonAnalyse.exe -Destination artifacts\ shell: powershell + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: XenonBinaries-${{ matrix.os }} + path: artifacts/* From aef9e00e3847c34f45921d9ae734a24846b5dc44 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 11:35:41 +0100 Subject: [PATCH 12/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index c398e6d..d0de59b 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -72,16 +72,16 @@ jobs: if: runner.os == 'Linux' run: | mkdir -p artifacts - cp build/XenonRecompiler/XenonRecompiler artifacts/ - cp build/XenonAnalyse/XenonAnalyse artifacts/ + cp build/XenonRecompiler artifacts/ + cp build/XenonAnalyse artifacts/ shell: bash - name: Package Artifacts (Windows) if: runner.os == 'Windows' run: | New-Item -ItemType Directory -Path artifacts - Copy-Item -Path build\XenonRecompiler\XenonRecompiler.exe -Destination artifacts\ - Copy-Item -Path build\XenonAnalyse\XenonAnalyse.exe -Destination artifacts\ + Copy-Item -Path build\XenonRecompiler.exe -Destination artifacts\ + Copy-Item -Path build\XenonAnalyse.exe -Destination artifacts\ shell: powershell - name: Upload Artifacts From 9f774261709574957cb286aaae9c31597b94feb4 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 12:02:14 +0100 Subject: [PATCH 13/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index d0de59b..e2e0951 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -68,11 +68,22 @@ jobs: run: cmake --build build --config ${{ matrix.build_type }} shell: powershell + - name: Show Build Directory (Linux) + if: runner.os == 'Linux' + run: tree -L 3 build + shell: bash + + - name: Show Build Directory (Windows) + if: runner.os == 'Windows' + run: Get-ChildItem -Path build -Recurse + shell: powershell + + - name: Package Artifacts (Linux) if: runner.os == 'Linux' run: | mkdir -p artifacts - cp build/XenonRecompiler artifacts/ + cp build/XenonRecomp artifacts/ cp build/XenonAnalyse artifacts/ shell: bash @@ -80,7 +91,7 @@ jobs: if: runner.os == 'Windows' run: | New-Item -ItemType Directory -Path artifacts - Copy-Item -Path build\XenonRecompiler.exe -Destination artifacts\ + Copy-Item -Path build\XenonRecomp.exe -Destination artifacts\ Copy-Item -Path build\XenonAnalyse.exe -Destination artifacts\ shell: powershell From b1f67eef400560a594c2378d228c2b3d34e1c94c Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 12:10:29 +0100 Subject: [PATCH 14/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index e2e0951..1856ba5 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -58,24 +58,19 @@ jobs: -S . shell: powershell - - name: Build (Linux) - if: runner.os == 'Linux' - run: cmake --build build --config ${{ matrix.build_type }} - shell: bash + - name: Build + run: ninja + - - name: Build (Windows) - if: runner.os == 'Windows' - run: cmake --build build --config ${{ matrix.build_type }} - shell: powershell - name: Show Build Directory (Linux) if: runner.os == 'Linux' - run: tree -L 3 build + run: tree -L 3 . shell: bash - name: Show Build Directory (Windows) if: runner.os == 'Windows' - run: Get-ChildItem -Path build -Recurse + run: Get-ChildItem -Path . -Recurse shell: powershell From be7f9c262600908b98abec8d45c4eedcb43b5704 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 12:12:13 +0100 Subject: [PATCH 15/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 1856ba5..6e0a98c 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -58,6 +58,16 @@ jobs: -S . shell: powershell + - name: Show CMake Directory (Linux) + if: runner.os == 'Linux' + run: tree -L 3 . + shell: bash + + - name: Show CMake Directory (Windows) + if: runner.os == 'Windows' + run: Get-ChildItem -Path . -Recurse + shell: powershell + - name: Build run: ninja From 789cb7c8a2f705d94bd97b3d5b09856ad80cc3d9 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 12:13:31 +0100 Subject: [PATCH 16/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 6e0a98c..d2b8f9b 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -39,7 +39,7 @@ jobs: - name: Configure CMake (Linux) if: runner.os == 'Linux' run: > - cmake -B build + cmake -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} @@ -50,7 +50,7 @@ jobs: - name: Configure CMake (Windows) if: runner.os == 'Windows' run: > - cmake -B build + cmake -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} From aeae099f7b1beb36d19af6f869e64e6a5a0773a8 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 12:16:09 +0100 Subject: [PATCH 17/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index d2b8f9b..50c0f50 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -88,16 +88,16 @@ jobs: if: runner.os == 'Linux' run: | mkdir -p artifacts - cp build/XenonRecomp artifacts/ - cp build/XenonAnalyse artifacts/ + cp XenonRecomp/XenonRecomp artifacts/ + cp XenonAnalyse/XenonAnalyse artifacts/ shell: bash - name: Package Artifacts (Windows) if: runner.os == 'Windows' run: | New-Item -ItemType Directory -Path artifacts - Copy-Item -Path build\XenonRecomp.exe -Destination artifacts\ - Copy-Item -Path build\XenonAnalyse.exe -Destination artifacts\ + Copy-Item -Path XenonRecomp\XenonRecomp.exe -Destination artifacts\ + Copy-Item -Path XenonAnalyse\XenonAnalyse.exe -Destination artifacts\ shell: powershell - name: Upload Artifacts From e6e872784c35de15c114558eab8f3d0fdc0703dd Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 12:56:01 +0100 Subject: [PATCH 18/23] Update README.md --- README.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/README.md b/README.md index b091a91..c490d28 100644 --- a/README.md +++ b/README.md @@ -251,24 +251,8 @@ The project requires CMake 3.20 or later and Clang 18 or later to build. Since t Compilers other than Clang have not been tested and are not recommended, including for recompilation output. The project relies on compiler-specific intrinsics and techniques that may not function correctly on other compilers, and many optimization methods depend on Clang's code generation. -### Linux - -**TODO** - -### Windows (Visual Studio) - On Windows, you can use the clang-cl toolset and open the project in Visual Studio's CMake integration. -### Windows (MSYS2) - -Alternatively, you can install [MSYS2](https://www.msys2.org/) and use the "MSYS2 CLANG64" environment to build the project. - -First, you need to install the necessary packages (`mingw-w64-clang-x86_64-cmake`, `mingw-w64-clang-x86_64-libc++` and `mingw-w64-x86_64-ninja`) with `pacman -S `. - -Then, you can head into the cloned repo's directory (you can access your C drive by going into the `/c` folder inside of MSYS2), and execute the command `cmake -DCMAKE_BUILD_TYPE=Debug .`, which will generate a `build.ninja` file for the project. - -Finally, run the `ninja` command, and you should end up with compiled executables. Attempting to launch them will tell you about a missing `libc++.dll` file, which you can copy to your current folder with the `cp /clang64/bin/libc++.dll .` command. - ## Special Thanks This project could not have been possible without the [Xenia](https://github.com/xenia-project/xenia) emulator, as many parts of the CPU code conversion process has been implemented by heavily referencing its PPC code translator. The project also uses code from [Xenia Canary](https://github.com/xenia-canary/xenia-canary) to patch XEX binaries. From e7984980b85acedd47204841ead47c67b493fd56 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 13:06:02 +0100 Subject: [PATCH 19/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 50c0f50..54d336a 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -58,31 +58,12 @@ jobs: -S . shell: powershell - - name: Show CMake Directory (Linux) - if: runner.os == 'Linux' - run: tree -L 3 . - shell: bash - - - name: Show CMake Directory (Windows) - if: runner.os == 'Windows' - run: Get-ChildItem -Path . -Recurse - shell: powershell - + - name: Build run: ninja - - name: Show Build Directory (Linux) - if: runner.os == 'Linux' - run: tree -L 3 . - shell: bash - - - name: Show Build Directory (Windows) - if: runner.os == 'Windows' - run: Get-ChildItem -Path . -Recurse - shell: powershell - - name: Package Artifacts (Linux) if: runner.os == 'Linux' From 74624c13643c90c13277cf6eca8b3ecf05a43583 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Tue, 4 Mar 2025 15:08:32 +0100 Subject: [PATCH 20/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 54d336a..49651a0 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -1,4 +1,4 @@ -name: CMake with Clang and Ninja +name: Build stuff on: push: From ef459b2b51630da2a370887f2f4d32d4adcd8d2a Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Tue, 4 Mar 2025 21:36:45 +0100 Subject: [PATCH 21/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 49651a0..68bd166 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -86,3 +86,37 @@ jobs: with: name: XenonBinaries-${{ matrix.os }} path: artifacts/* + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download Linux Build Artifacts + uses: actions/download-artifact@v4 + with: + name: XenonBinaries-Linux + path: artifacts + + - name: Download Windows Build Artifacts + uses: actions/download-artifact@v4 + with: + name: XenonBinaries-Windows + path: artifacts + + - name: Create GitHub Release + id: create_release + uses: softprops/action-gh-release@v2 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + with: + tag_name: ${{ github.ref_name }} + name: Release ${{ github.ref_name }} + body: | + **Automated release for** ${{ github.ref_name }} + + - Includes builds for **Linux** and **Windows**. + draft: false + prerelease: false + files: | + artifacts/XenonBinaries-Linux.tar.gz + artifacts/XenonBinaries-Windows.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e4d8d6987abf7cc26ad28070fbc55214c76004cc Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Tue, 4 Mar 2025 21:40:45 +0100 Subject: [PATCH 22/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 68bd166..7646a8b 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -93,13 +93,13 @@ jobs: - name: Download Linux Build Artifacts uses: actions/download-artifact@v4 with: - name: XenonBinaries-Linux + name: XenonBinaries-ubuntu-latest path: artifacts - name: Download Windows Build Artifacts uses: actions/download-artifact@v4 with: - name: XenonBinaries-Windows + name: XenonBinaries-windows-latest path: artifacts - name: Create GitHub Release From 6a863f4cd387f858f7cf861df6dd3ea800817d30 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Tue, 4 Mar 2025 21:41:53 +0100 Subject: [PATCH 23/23] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 7646a8b..03dd7cd 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -116,7 +116,7 @@ jobs: draft: false prerelease: false files: | - artifacts/XenonBinaries-Linux.tar.gz - artifacts/XenonBinaries-Windows.zip + artifacts/XenonBinaries-ubuntu-latest.zip + artifacts/XenonBinaries-windows-latest.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}