# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

---
name: Install Skia dependencies
description: Set up dependencies needed to build Skia

runs:
    using: composite
    steps:
        - name: Upgrade LLVM for Skia build on Windows
          if: runner.os == 'Windows'
          run: choco upgrade llvm --version "19.1.7" --allow-downgrade
          shell: bash
        # See https://github.com/ilammy/msvc-dev-cmd?tab=readme-ov-file#caveats
        - name: Remove GNU link.exe from GH actions
          if: runner.os == 'Windows'
          run: rm /usr/bin/link
          shell: bash
        - name: Unselect homebrew clang to work around https://github.com/actions/runner-images/issues/13827
          if: runner.os == 'macOS'
          shell: bash
          run: |
              echo "CLANGCC=/usr/bin/clang" >> $GITHUB_ENV
              echo "CLANGCXX=/usr/bin/clang++" >> $GITHUB_ENV
              libclang_path=$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/lib/
              echo "LIBCLANG_PATH=$libclang_path" >> $GITHUB_ENV
