diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 413678a19..7808db1f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,7 +80,7 @@ jobs: name: spaghetti-windows path: spaghetti-${{ matrix.config }} - build-macos: + build-macos-arm64: needs: generate-port-o2r runs-on: macOS-latest strategy: @@ -119,7 +119,49 @@ jobs: if: matrix.config == 'Release' uses: actions/upload-artifact@v4 with: - name: spaghetti-mac-x64 + name: spaghetti-mac-arm64 + path: spaghetti-${{ matrix.config }} + + build-macos-intel: + needs: generate-port-o2r + runs-on: macOS-13 + strategy: + matrix: + config: [Release, Debug] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Install dependencies + run: brew install ninja cmake + - name: Install vcpkg + uses: lukka/run-vcpkg@v11.5 + with: + vcpkgDirectory: '${{ github.workspace }}/vcpkg' + - name: Build + run: | + cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + cmake --build build-cmake --config ${{ matrix.config }} -j3 + - name: Download spaghetti.o2r + uses: actions/download-artifact@v4 + with: + name: spaghetti.o2r + path: ./build-cmake + - name: Create Package + run: | + mkdir spaghetti-${{ matrix.config }} + mv build-cmake/Spaghettify spaghetti-${{ matrix.config }}/ + mv build-cmake/spaghetti.o2r spaghetti-${{ matrix.config }}/ + mv config.yml spaghetti-${{ matrix.config }}/ + mv yamls spaghetti-${{ matrix.config }}/ + wget -O spaghetti-${{ matrix.config }}/gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt + - name: Publish packaged artifacts + if: matrix.config == 'Release' + uses: actions/upload-artifact@v4 + with: + name: spaghetti-mac-intel-x64 path: spaghetti-${{ matrix.config }} build-linux: diff --git a/CMakeLists.txt b/CMakeLists.txt index 66396af39..10d8bc91b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,7 @@ include(cmake/automate-vcpkg.cmake) set(VCPKG_TRIPLET x64-windows-static) set(VCPKG_TARGET_TRIPLET x64-windows-static) vcpkg_bootstrap() -vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3 nlohmann-json tinyxml2 spdlog libogg libvorbis) +vcpkg_install_packages() set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME}) set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) diff --git a/README.md b/README.md index 7d0addec5..a5891391f 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,8 @@ If you want to playtest a continuous integration build, you can find them at the * [Windows](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghetti-windows.zip?status=completed) * [Linux](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghetti-linux-x64.zip?status=completed) -* [macOS](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghetti-mac-x64.zip?status=completed) +* [macOS-arm64](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghetti-mac-arm64.zip?status=completed) +* [macOS-intel](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghetti-mac-intel-x64.zip?status=completed) * [Switch](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/Spaghettify-switch.zip?status=completed) Maintainers: [MegaMech](https://www.github.com/MegaMech), [Coco](https://www.github.com/coco875), [Kirito](https://github.com/KiritoDv) diff --git a/src/port/pak.cpp b/src/port/pak.cpp index c549a9868..4adedd6a0 100644 --- a/src/port/pak.cpp +++ b/src/port/pak.cpp @@ -1,6 +1,12 @@ #include #include +#if __has_include() +#include +#define fmt(...) fmt::format(__VA_ARGS__) +#else #include +#define fmt(...) std::format(__VA_ARGS__) +#endif #include #include @@ -17,7 +23,7 @@ typedef struct ControllerPak { } ControllerPak; std::string Pfs_PakFile_GetPath(u8 file_no) { - return Ship::Context::GetPathRelativeToAppDirectory(std::format("controllerPak_file_{}.sav", file_no)); + return Ship::Context::GetPathRelativeToAppDirectory(fmt("controllerPak_file_{}.sav", file_no)); } std::string Pfs_PakHeader_GetPath() {