-
-
Save mathias-bevers/8abe4ca2273a278859e0b5ad6ee57d1d to your computer and use it in GitHub Desktop.
Fix Unity NDK Path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| UNITY_HUB_EDITOR=${1:-$HOME/Unity/Hub/Editor} | |
| pushd "$UNITY_HUB_EDITOR" > /dev/null | |
| for UNITY in *; do | |
| echo "Checking: $UNITY" | |
| CLANGPP="$UNITY_HUB_EDITOR/$UNITY/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++" | |
| if ! [ -f "$CLANGPP" ]; then | |
| echo " Android Build Support is not installed" | |
| continue | |
| fi | |
| LINKED_TO=$(readlink "$CLANGPP") | |
| NDK_VERSION=$(sed -nE 's/^.*\/NDK\/(.*)\/toolchains\/.*$/\1/p' <<<"$LINKED_TO") | |
| echo " NDK version detected: $NDK_VERSION" | |
| pushd "$UNITY_HUB_EDITOR/$UNITY/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/" > /dev/null | |
| echo " Making symlink" | |
| ln -s ./ "./$NDK_VERSION" | |
| popd > /dev/null | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment