From 4b0a98bbc314868a1057b303745831743e1d356c Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 09:13:21 +0100 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 0126b5bdfbbbc47932248f1663d7b5e495695b0a Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 09:50:25 +0100 Subject: [PATCH 4/7] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 72 ---------------------- 1 file changed, 72 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 3d37556..8b13789 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -1,73 +1 @@ -# 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: - - 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. - 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 4d4e8827441e02bcc0402ed56bb14ff8b992df02 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 09:53:03 +0100 Subject: [PATCH 5/7] Delete .github/workflows directory --- .github/workflows/cmake-multi-platform.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/workflows/cmake-multi-platform.yml diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml deleted file mode 100644 index 8b13789..0000000 --- a/.github/workflows/cmake-multi-platform.yml +++ /dev/null @@ -1 +0,0 @@ - From f77fcb103a73329ad6e69b5d67b5478edbd73fbc Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Mon, 3 Mar 2025 09:59:10 +0100 Subject: [PATCH 6/7] Create cmake-multi-platform.yml empty workflow not important --- .github/workflows/cmake-multi-platform.yml | 1 + 1 file changed, 1 insertion(+) 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..9aa4e25 --- /dev/null +++ b/.github/workflows/cmake-multi-platform.yml @@ -0,0 +1 @@ +² From 7bcf4e0484e1f0d14487ba38e977855379458303 Mon Sep 17 00:00:00 2001 From: Sakimotor Date: Tue, 4 Mar 2025 02:34:27 +0100 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b091a91..55baa22 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ On Windows, you can use the clang-cl toolset and open the project in Visual Stud 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 `. +First, you need to install the necessary packages (`mingw-w64-clang-x86_64-cmake`, `mingw-w64-clang-x86_64-libc++`, `mingw-w64-clang-x86_64-clang` 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.