summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml
diff options
context:
space:
mode:
Diffstat (limited to 'src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml')
-rw-r--r--src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml b/src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml
new file mode 100644
index 0000000..e7f9ddc
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml
@@ -0,0 +1,53 @@
1name: 'Setup LoongArch64 toolchain'
2description: 'Download Linux LoongArch64 toolchain and set output variables'
3inputs:
4 version:
5 description: 'LoongArch64 version'
6 default: '2023.08.08'
7outputs:
8 prefix:
9 description: "LoongArch toolchain prefix"
10 value: ${{ steps.final.outputs.prefix }}
11 cc:
12 description: "LoongArch C compiler"
13 value: ${{ steps.final.outputs.cc }}
14 cxx:
15 description: "LoongArch C++ compiler"
16 value: ${{ steps.final.outputs.cxx }}
17runs:
18 using: 'composite'
19 steps:
20 - uses: actions/cache/restore@v4
21 id: restore-cache
22 with:
23 path: /opt/cross-tools
24 key: loongarch64-${{ inputs.version }}
25
26 - name: 'Download LoongArch64 gcc+glibc toolchain'
27 if: ${{ !steps.restore-cache.outputs.cache-hit }}
28 shell: bash
29 run: |
30 url="https://github.com/loongson/build-tools/releases/download/${{ inputs.version }}/CLFS-loongarch64-8.1-x86_64-cross-tools-gcc-glibc.tar.xz"
31
32 wget "$url" -O /tmp/toolchain.tar.xz
33
34 mkdir -p /opt
35 tar -C /opt -x -f /tmp/toolchain.tar.xz
36
37 - uses: actions/cache/save@v4
38 if: ${{ !steps.restore-cache.outputs.cache-hit }}
39 with:
40 path: /opt/cross-tools
41 key: loongarch64-${{ inputs.version }}
42 - name: 'Set output vars'
43 id: final
44 shell: bash
45 run: |
46 prefix=/opt/cross-tools
47 echo "prefix=${prefix}" >> $GITHUB_OUTPUT
48 cc="${prefix}/bin/loongarch64-unknown-linux-gnu-gcc"
49 cxx="${prefix}/bin/loongarch64-unknown-linux-gnu-g++"
50 echo "cc=${cc}" >> $GITHUB_OUTPUT
51 echo "cxx=${cxx}" >> $GITHUB_OUTPUT
52 echo "LOONGARCH64_CC=${cc}" >>$GITHUB_ENV
53 echo "LOONGARCH64_CXX=${cxx}" >>$GITHUB_ENV