From 59e820e27fd2c5cc0fc9effb4418b1017b313734 Mon Sep 17 00:00:00 2001 From: Kolyah35 Date: Sat, 21 Mar 2026 00:33:59 +0300 Subject: [PATCH] setup ninja --- .github/actions/setup-ninja/action.yml | 17 +++++++++++++++++ .github/workflows/build.yml | 7 ++++++- src/main.cpp | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .github/actions/setup-ninja/action.yml diff --git a/.github/actions/setup-ninja/action.yml b/.github/actions/setup-ninja/action.yml new file mode 100644 index 0000000..89de375 --- /dev/null +++ b/.github/actions/setup-ninja/action.yml @@ -0,0 +1,17 @@ +name: Setup Ninja +description: Sets up Ninja + +inputs: + host: + description: 'Host platform: win, mac or linux' + required: true + +runs: + using: "composite" + steps: + - name: Setup + shell: bash + run: | + curl -L https://github.com/ninja-build/ninja/releases/latest/download/ninja-${{ inputs.host }}.zip -o ninja.zip + 7z x ninja.zip -o"$GITHUB_WORKSPACE/ninja" + echo "$GITHUB_WORKSPACE/ninja" >> $GITHUB_PATH \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5df95ea..ac49ed5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,11 @@ jobs: host: win target: win + - name: Setup Ninja + uses: ./.github/actions/setup-ninja + with: + host: linux + - name: Download xwin uses: robinraju/release-downloader@v1.10 with: @@ -93,7 +98,7 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/build - run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G Ninja env: SPLAT_DIR: ${{ github.workspace }}/.xwin-cache/splat TOOLCHAIN: ${{ github.workspace }}/toolchain/clang-cl-msvc.cmake diff --git a/src/main.cpp b/src/main.cpp index d2e9138..885f4bc 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,7 +27,7 @@ // #endif -#ifdef PLATFORM_DESKTOP +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) #include "main_glfw.h" #endif