Skip to content

Commit

Permalink
ci: llvm stable or latest
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Jul 31, 2023
1 parent c43b1c0 commit 329dff7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 34 deletions.
58 changes: 32 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:

env:
FF_VER: master
LLVM_VER: 16
VC_LTL_VER: 5.0.5
LLVM_VER: ${{ vars.LLVM_VER }}
VC_LTL_VER: ${{ vars.VC_LTL_VER }}
NINJA_STATUS: '[%f/%t %e %r]'
SF_PW: ${{ secrets.SF_PW }}
SF_USER: ${{ secrets.SF_USER }}
Expand All @@ -35,7 +35,7 @@ jobs:
with:
repository: wang-bin/mdk
path: mdk
ref: master
ref: master # TODO: dispatch ref
fetch-depth: 1
token: ${{ secrets.CLONE_PAT }}
submodules: 'recursive'
Expand All @@ -49,7 +49,7 @@ jobs:
./mdk/external
!./mdk/external/lib/macOS/libvulkan.tbd
!./mdk/external/lib/libdav1d.tbd
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
# why may failed to cache/restore /usr/local/bin/sshpass?
# no build cache because build dir content changes but key should not, then no cache save.
- name: Create Build Environment
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
path: |
./mdk/external
!./mdk/external/lib/libdav1d.tbd
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
# why may failed to cache/restore /usr/local/bin/sshpass?
# no build cache because build dir content changes but key should not, then no cache save.
- name: Create Build Environment
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
./mdk/external
!./mdk/external/lib/macOS/libvulkan.tbd
!./mdk/external/lib/libdav1d.tbd
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
# why may failed to cache/restore /usr/local/bin/sshpass?
# no build cache because build dir content changes but key should not, then no cache save.
- name: Create Build Environment
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:
./mdk/external
!./mdk/external/lib/macOS/libvulkan.tbd
!./mdk/external/lib/libdav1d.tbd
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
# why may failed to cache/restore /usr/local/bin/sshpass?
# no build cache because build dir content changes but key should not, then no cache save.
- name: Create Build Environment
Expand Down Expand Up @@ -416,13 +416,13 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: ./mdk/sysroot
key: sysroot-${{ env.TARGET_OS }}-${{ secrets.RPI_SYSROOT_ID }}
key: sysroot-${{ env.TARGET_OS }}-${{ vars.RPI_SYSROOT_ID }}
- name: Create Build Environment
shell: bash
env:
Expand All @@ -436,7 +436,7 @@ jobs:
working-directory: mdk
run: |
pwd
cmake -DUSE_LTO=thin -DCMAKE_C_COMPILER=clang-${LLVM_VER} -DCMAKE_CXX_COMPILER=clang++-${LLVM_VER} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/${TARGET_OS/r*pi/rpi}.clang.cmake -DLINUX_SYSROOT=$PWD/sysroot -GNinja -H$PWD -B$PWD/build/${TARGET_OS} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk -DCMAKE_VERBOSE_MAKEFILE=1
cmake -DUSE_LTO=thin -DCMAKE_C_COMPILER=clang-${LLVM_VER:-17} -DCMAKE_CXX_COMPILER=clang++-${LLVM_VER:-17} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/${TARGET_OS/r*pi/rpi}.clang.cmake -DLINUX_SYSROOT=$PWD/sysroot -GNinja -H$PWD -B$PWD/build/${TARGET_OS} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk -DCMAKE_VERBOSE_MAKEFILE=1
- name: Build
shell: bash
working-directory: mdk
Expand Down Expand Up @@ -482,7 +482,7 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: Create Build Environment
shell: bash
env:
Expand Down Expand Up @@ -575,7 +575,7 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: Create Build Environment
shell: bash
env:
Expand Down Expand Up @@ -643,13 +643,13 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-${{ env.CRT_EXTRA }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-${{ env.CRT_EXTRA }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore VC-LTL cache'
id: ltl-cache
uses: actions/cache@v3
with:
path: ./mdk/cmake/VC-LTL
key: ltl-${{ env.VC_LTL_VER }}
key: ltl-${{ vars.VC_LTL_VER }}
- if: ${{ steps.ltl-cache.outputs.cache-hit != 'true' }}
name: Get VC-LTL
shell: bash
Expand Down Expand Up @@ -726,7 +726,7 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: Create Build Environment
shell: bash
env:
Expand Down Expand Up @@ -810,21 +810,23 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: /tmp/winsysroot
key: sysroot-${{ env.TARGET_OS }}${{ secrets.WINSDKVER }}-vc${{ secrets.VCVER }}
key: sysroot-${{ env.TARGET_OS }}${{ vars.WINSDKVER }}-vc${{ vars.VCVER }}
- name: Create Build Environment
shell: bash
env:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-cache.outputs.cache-hit }}
SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
../ci-before-build.sh
- name: Configure for win arm64
shell: bash
env:
Expand Down Expand Up @@ -912,21 +914,23 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: /tmp/winsysroot
key: sysroot-${{ env.TARGET_OS }}${{ secrets.WINSDKVER }}-vc${{ secrets.VCVER }}
key: sysroot-${{ env.TARGET_OS }}${{ vars.WINSDKVER }}-vc${{ vars.VCVER }}
- name: Create Build Environment
shell: bash
env:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-cache.outputs.cache-hit }}
SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
../ci-before-build.sh
- name: Configure for UWP arm
if: ${{ matrix.config == 'Release' || matrix.config == 'MinSizeRel' }}
shell: bash
Expand Down Expand Up @@ -995,7 +999,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: mdk-sdk-vs2022-windows-desktop-MinSizeRel
- name: Download win32 vs2022 sdk
- name: Download win32 vs2022 ltl sdk
uses: actions/download-artifact@v3
with:
name: mdk-sdk-vs2022-ltl-windows-desktop-MinSizeRel
Expand Down Expand Up @@ -1058,21 +1062,23 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: 'Restore sysroot cache'
id: sysroot-cache
uses: actions/cache@v3
with:
path: ./mdk/sysroot
key: sysroot-${{ env.TARGET_OS }}-${{ secrets.LINUX_SYSROOT_ID }}
key: sysroot-${{ env.TARGET_OS }}-${{ vars.LINUX_SYSROOT_ID }}
- name: Create Build Environment
shell: bash
env:
DEVTOOLS_CACHE_HIT: ${{ steps.devtools-cache.outputs.cache-hit }}
SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
working-directory: mdk
run: ../ci-before-build.sh
run: |
sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
../ci-before-build.sh
- name: Configure for x64
env:
ARCH: amd64
Expand Down Expand Up @@ -1149,7 +1155,7 @@ jobs:
uses: actions/cache@v3
with:
path: ./mdk/external
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ secrets.FF_SDK_ID }}-dav1d${{ secrets.DAV1D_ID }}
key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}-dav1d${{ vars.DAV1D_ID }}
- name: Create Build Environment
shell: bash
env:
Expand Down
3 changes: 1 addition & 2 deletions ci-after-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
LLVER=${LLVM_VER:-16}
ls -lh build/${TARGET_OS}*
if [ -f build/${TARGET_OS}/libmdk.so ]; then
readelf -d build/${TARGET_OS}/libmdk.so
Expand All @@ -21,7 +20,7 @@ for s in build/${TARGET_OS}-*; do
fi
done
find mdk-sdk* -name "*.a" -delete
: ${STRIP:=llvm-strip-$LLVER}
: ${STRIP:=llvm-strip}
[ "$TARGET_OS" == "macOS" ] && STRIP=strip
which $STRIP && find mdk-sdk*/bin -executable -type f -exec $STRIP {} \;
export XZ_OPT="--threads=`getconf _NPROCESSORS_ONLN`" # -9e. -8/9 will disable mt?
Expand Down
8 changes: 3 additions & 5 deletions ci-before-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
LLVER=${LLVM_VER:-16}
NDK_HOST=linux
FF_EXTRA=-clang
FFPKG_EXT=tar.xz
Expand All @@ -25,14 +24,13 @@ if [ `which dpkg` ]; then # TODO: multi arch
pkgs="sshpass cmake ninja-build p7zip-full"
#wget https://apt.llvm.org/llvm.sh
if [[ "$TARGET_OS" != android ]]; then
pkgs+=" lld-$LLVER clang-tools-$LLVER" # clang-tools: clang-cl
#bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${LLVM_VER}
sudo ./llvm.sh ${LLVM_VER} all
fi
if [ "$TARGET_OS" == "linux" ]; then
pkgs+=" libc++-$LLVER-dev libc++abi-$LLVER-dev libegl1-mesa-dev libgles2-mesa-dev libgl1-mesa-dev libgbm-dev libx11-dev libwayland-dev libasound2-dev libopenal-dev libpulse-dev libva-dev libvdpau-dev libglfw3-dev libsdl2-dev"
pkgs+=" libegl1-mesa-dev libgles2-mesa-dev libgl1-mesa-dev libgbm-dev libx11-dev libwayland-dev libasound2-dev libopenal-dev libpulse-dev libva-dev libvdpau-dev libglfw3-dev libsdl2-dev"
elif [ "$TARGET_OS" == "sunxi" -o "$TARGET_OS" == "raspberry-pi" ]; then
pkgs+=" binutils-arm-linux-gnueabihf"
fi
Expand Down Expand Up @@ -135,4 +133,4 @@ if [[ "$EXTERNAL_DEP_CACHE_HIT" != "true" ]]; then
7z x -y dav1d.deb
tar xvf data.tar
mv usr/include/dav1d external/include/
fi
fi
2 changes: 1 addition & 1 deletion nuget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
- [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
- [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
- Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11, D3D12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://github.com/wang-bin/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML) etc.) easily
- Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11, D3D12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML) etc.) easily
- [HDR display, HDR to SDR and SDR to HDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
- [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
- Subtitle rendering, including ass, plain text, bitmap, closed caption
Expand Down

0 comments on commit 329dff7

Please sign in to comment.