Skip to content

Commit

Permalink
Setup LLVM on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed May 31, 2024
1 parent a0351bc commit 5d5f87e
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ jobs:
submodules: 'recursive'
lfs: true
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
- name: Set Rust toolchain override
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- run: |
brew install llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"'
echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV"
echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV"
echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV"
echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV"
echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
Expand All @@ -94,6 +102,14 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- run: |
brew install llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"'
echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV"
echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV"
echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV"
echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV"
echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ jobs:
submodules: 'recursive'
lfs: true

- if: ${{ matrix.os == 'macos-13-xlarge' }}
run: |
brew install llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"'
echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV"
echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV"
echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV"
echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV"
echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV"
- if: ${{ matrix.os == 'macos-12' }}
run: |
brew install llvm
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"'
echo 'export LIBCLANG_PATH=/usr/local/opt/llvm' >> "$GITHUB_ENV"
echo 'export DYLD_LIBRARY_PATH="/usr/local/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV"
echo 'export LDFLAGS="-L/usr/local/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV"
echo 'export CPPFLAGS="-I/usr/local/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV"
echo 'export CFLAGS="-I/usr/local/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV"
- name: Install NASM on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- if: ${{ matrix.os == 'macos-13-xlarge' }}
run: |
brew install llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"'
echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV"
echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV"
echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV"
echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV"
echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV"
- if: ${{ matrix.os == 'macos-12' }}
run: |
brew install llvm
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"'
echo 'export LIBCLANG_PATH=/usr/local/opt/llvm' >> "$GITHUB_ENV"
echo 'export DYLD_LIBRARY_PATH="/usr/local/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV"
echo 'export LDFLAGS="-L/usr/local/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV"
echo 'export CPPFLAGS="-I/usr/local/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV"
echo 'export CFLAGS="-I/usr/local/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
Expand Down Expand Up @@ -376,6 +394,24 @@ jobs:
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
- if: ${{ matrix.os == 'macos-13-xlarge' }}
run: |
brew install llvm
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"'
echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV"
echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV"
echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV"
echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV"
echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV"
- if: ${{ matrix.os == 'macos-12' }}
run: |
brew install llvm
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"'
echo 'export LIBCLANG_PATH=/usr/local/opt/llvm' >> "$GITHUB_ENV"
echo 'export DYLD_LIBRARY_PATH="/usr/local/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV"
echo 'export LDFLAGS="-L/usr/local/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV"
echo 'export CPPFLAGS="-I/usr/local/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV"
echo 'export CFLAGS="-I/usr/local/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV"
- name: Set Rust toolchain override
run: rustup override set ${{ steps.toolchain.outputs.name }}
- name: Install cargo-careful
Expand Down

0 comments on commit 5d5f87e

Please sign in to comment.