Skip to content

find_package

find_package #55

Workflow file for this run

name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- { os: windows-latest, runtime: win-x64 }
- { os: ubuntu-latest, runtime: linux-x64 }
- { os: macos-latest, runtime: osx-arm64 }
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2
- name: Build
run: dotnet build
- name: Download LLVM
run: dotnet run --project ./AssetRipper.Bindings.LLVM.Downloader/AssetRipper.Bindings.LLVM.Downloader.csproj 21.1.8 ${{ matrix.config.runtime }}
- name: List LLVM Directory
run: ls -R ${{ github.workspace }}/AssetRipper.Bindings.LLVM.Downloader/bin/Debug/net10.0/llvm
- name: Set up Clang
if: matrix.config.runtime == 'linux-x64' || matrix.config.runtime == 'linux-arm64' || matrix.config.runtime == 'osx-arm64'
uses: KyleMayes/install-llvm-action@v2
with:
version: "21.1.8"
- name: Set LLVM Path
id: get-llvm-path
shell: bash
run: |
echo "llvm_path=${GITHUB_WORKSPACE}/AssetRipper.Bindings.LLVM.Downloader/bin/Debug/net10.0/llvm" >> $GITHUB_OUTPUT
- name: Build Native Library (Windows)
if: matrix.config.runtime == 'win-x64' || matrix.config.runtime == 'win-arm64'
run: |
cmake -S ./Native -B ./Native/build -DLLVM_ROOT="${{ steps.get-llvm-path.outputs.llvm_path }}"
cmake --build ./Native/build --config Release
- name: Build Native Library (Linux)
if: matrix.config.runtime == 'linux-x64' || matrix.config.runtime == 'linux-arm64'
run: |
cmake -S ./Native -B ./Native/build -DLLVM_ROOT="${{ steps.get-llvm-path.outputs.llvm_path }}" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_BUILD_TYPE=Release
cmake --build ./Native/build --config Release
- name: Build Native Library (MacOS)
if: matrix.config.runtime == 'osx-arm64'
run: |
cmake -S ./Native -B ./Native/build -DLLVM_ROOT="${{ steps.get-llvm-path.outputs.llvm_path }}" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_BUILD_TYPE=Release
cmake --build ./Native/build --config Release
- name: List Native Directory
run: ls -R ${{ github.workspace }}/Native
- name: Upload Artifacts
uses: actions/upload-artifact@v6
with:
name: libLLVM_${{ matrix.config.runtime }}
path: |
./Native/build/Release/libLLVM.dll
./Native/build/libLLVM.so
./Native/build/libLLVM.dylib
if-no-files-found: error