From 4fd7d5ebcb94b10232df03a5f63f81bffa685fbc Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Sun, 30 Jan 2022 10:35:46 +0100 Subject: [PATCH] Fixed ninja not found for NDK builds Signed-off-by: Alexander Borsuk --- .github/workflows/android-beta.yaml | 7 +++++++ .github/workflows/android-check.yaml | 7 +++++++ .github/workflows/android-monkey.yaml | 9 ++++++++- .github/workflows/android-release.yaml | 7 +++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android-beta.yaml b/.github/workflows/android-beta.yaml index 1a60586ad8..6f45d042a3 100644 --- a/.github/workflows/android-beta.yaml +++ b/.github/workflows/android-beta.yaml @@ -34,6 +34,13 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y ninja-build + # Hack needed to make ninja visible to cmake during NDK builds. + # See https://issuetracker.google.com/issues/206099937 + CMAKE_DIR=$(dirname $(which cmake)) + NINJA_DIR=$(dirname $(which ninja)) + if [ "$CMAKE_DIR" != "$NINJA_DIR" ]; then + ln -s "$(which ninja)" "$CMAKE_DIR/ninja" + fi - name: Set up JDK 11 uses: actions/setup-java@v1 diff --git a/.github/workflows/android-check.yaml b/.github/workflows/android-check.yaml index 2db0da5b79..67246ace9a 100644 --- a/.github/workflows/android-check.yaml +++ b/.github/workflows/android-check.yaml @@ -33,6 +33,13 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y ninja-build + # Hack needed to make ninja visible to cmake during NDK builds. + # See https://issuetracker.google.com/issues/206099937 + CMAKE_DIR=$(dirname $(which cmake)) + NINJA_DIR=$(dirname $(which ninja)) + if [ "$CMAKE_DIR" != "$NINJA_DIR" ]; then + ln -s "$(which ninja)" "$CMAKE_DIR/ninja" + fi - name: Set up JDK 11 uses: actions/setup-java@v1 diff --git a/.github/workflows/android-monkey.yaml b/.github/workflows/android-monkey.yaml index a3f03c2afb..248b14c2cc 100644 --- a/.github/workflows/android-monkey.yaml +++ b/.github/workflows/android-monkey.yaml @@ -19,7 +19,7 @@ jobs: shell: bash run: | DIRS="android base drape drape_frontend editor ge0 map platform routing search shaders storage traffic transit" - if [ '${{ github.event_name }}' != 'schedule' ] || + if [ '${{ github.event_name }}' != 'schedule' ] || [ $(git rev-list --count --since="24 hours" HEAD $DIRS) -gt 0 ]; then echo "::set-output name=updated::true" else @@ -40,6 +40,13 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y ninja-build + # Hack needed to make ninja visible to cmake during NDK builds. + # See https://issuetracker.google.com/issues/206099937 + CMAKE_DIR=$(dirname $(which cmake)) + NINJA_DIR=$(dirname $(which ninja)) + if [ "$CMAKE_DIR" != "$NINJA_DIR" ]; then + ln -s "$(which ninja)" "$CMAKE_DIR/ninja" + fi - name: Set up JDK 11 uses: actions/setup-java@v1 diff --git a/.github/workflows/android-release.yaml b/.github/workflows/android-release.yaml index 6065eb0796..966caeee5f 100644 --- a/.github/workflows/android-release.yaml +++ b/.github/workflows/android-release.yaml @@ -75,6 +75,13 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y ninja-build + # Hack needed to make ninja visible to cmake during NDK builds. + # See https://issuetracker.google.com/issues/206099937 + CMAKE_DIR=$(dirname $(which cmake)) + NINJA_DIR=$(dirname $(which ninja)) + if [ "$CMAKE_DIR" != "$NINJA_DIR" ]; then + ln -s "$(which ninja)" "$CMAKE_DIR/ninja" + fi - name: Set up JDK 11 uses: actions/setup-java@v1