|
| 1 | + |
| 2 | +name: android-ndk-windows-llvm-msvc.yml |
| 3 | + |
| 4 | +permissions: |
| 5 | + contents: write |
| 6 | + |
| 7 | +on: [push, pull_request] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + # Skip building pull requests from the same repository |
| 12 | + if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + os: [windows-latest] |
| 18 | + env: |
| 19 | + BUILD_TYPE: Release |
| 20 | + steps: |
| 21 | + |
| 22 | + - name: Checkout Repo |
| 23 | + uses: actions/checkout@v3 |
| 24 | + with: |
| 25 | + path: llvm-msvc |
| 26 | + submodules: 'recursive' |
| 27 | + |
| 28 | + - name: Build llvm |
| 29 | + run: | |
| 30 | + cmake -Bbuild ` |
| 31 | + -DLLVM_INCLUDE_TESTS=OFF ` |
| 32 | + -DLLVM_INCLUDE_EXAMPLES=OFF ` |
| 33 | + -DLLDB_ENABLE_PYTHON=OFF ` |
| 34 | + -DLLVM_ENABLE_LIBXML2=OFF ` |
| 35 | + -DLLVM_ENABLE_ZLIB=OFF ` |
| 36 | + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` |
| 37 | + -DLLVM_USE_CRT_RELEASE=MT ` |
| 38 | + -DCMAKE_INSTALL_PREFIX=install ` |
| 39 | + -DLLVM_TARGETS_TO_BUILD="X86;AArch64" ` |
| 40 | + -DLLVM_ENABLE_PROJECTS="clang;lld" ` |
| 41 | + llvm-msvc\\llvm |
| 42 | + cmake --build build --config ${{ env.BUILD_TYPE }} |
| 43 | + cmake --build build --config ${{ env.BUILD_TYPE }} --target install |
| 44 | + |
| 45 | + - name: Package ndk-26c |
| 46 | + run: | |
| 47 | + Invoke-WebRequest -Uri "https://github.com/gmh5225/android-ndk-windows-llvm-msvc/releases/download/r26c/android-ndk-r26c-windows-llvm-msvc.7z" -OutFile "android-ndk-r26c-windows-llvm-msvc.7z" |
| 48 | + 7z x "android-ndk-r26c-windows-llvm-msvc.7z" |
| 49 | + del android-ndk-r26c-windows-llvm-msvc.7z |
| 50 | + Copy-Item -Path "install\bin\clang.exe" -Destination "android-ndk-r26c-windows-llvm-msvc\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe" -Force |
| 51 | + Copy-Item -Path "install\bin\clang++.exe" -Destination "android-ndk-r26c-windows-llvm-msvc\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe" -Force |
| 52 | + Copy-Item -Path "install\bin\clang-cpp.exe" -Destination "android-ndk-r26c-windows-llvm-msvc\toolchains\llvm\prebuilt\windows-x86_64\bin\clang-cpp.exe" -Force |
| 53 | + Copy-Item -Path "install\bin\clang-cl.exe" -Destination "android-ndk-r26c-windows-llvm-msvc\toolchains\llvm\prebuilt\windows-x86_64\bin\clang-cl.exe" -Force |
| 54 | + Copy-Item -Path "install\bin\ld.lld.exe" -Destination "android-ndk-r26c-windows-llvm-msvc\toolchains\llvm\prebuilt\windows-x86_64\bin\ld.lld.exe" -Force |
| 55 | + Copy-Item -Path "install\bin\lld.exe" -Destination "android-ndk-r26c-windows-llvm-msvc\toolchains\llvm\prebuilt\windows-x86_64\bin\ld.exe" -Force |
| 56 | + Copy-Item -Path "install\lib\clang" -Destination "android-ndk-r26c-windows-llvm-msvc\toolchains\llvm\prebuilt\windows-x86_64\lib" -Recurse -Force |
| 57 | + 7z a -mx=9 android-ndk-r26c-windows-llvm-msvc.7z android-ndk-r26c-windows-llvm-msvc |
| 58 | + |
| 59 | + - name: Upload ndk-26c |
| 60 | + uses: actions/upload-artifact@v2 |
| 61 | + with: |
| 62 | + name: android-ndk-r26c-windows-llvm-msvc |
| 63 | + path: android-ndk-r26c-windows-llvm-msvc.7z |
| 64 | + |
| 65 | + - name: Release ndk-26c |
| 66 | + uses: softprops/action-gh-release@v1 |
| 67 | + if: ${{ startsWith(github.ref, 'refs/tags/') }} |
| 68 | + with: |
| 69 | + prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') || contains(github.ref, '-pre') }} |
| 70 | + files: android-ndk-r26c-windows-llvm-msvc.7z |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 73 | + |
| 74 | + |
0 commit comments