Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build llvm for different versions of visual studio #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 42 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This is a basic workflow to help you get started with Actions

name: Build

# Controls when the workflow will run
Expand All @@ -21,18 +19,32 @@ jobs:
runs-on: windows-latest
env:
llvm_version: 14.0.6
strategy:
fail-fast: true
matrix:
config:
- {
version: "17",
year: "2022",
name: "msvc17"
}
- {
version: "16",
year: "2019",
name: "msvc16",
}


# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get CMake
uses: lukka/get-cmake@latest

- name: Checkout llvm
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: llvm/llvm-project
ref: "llvmorg-${{ env.llvm_version }}"
Expand All @@ -47,20 +59,43 @@ jobs:
cmake `
-S ".\llvm\llvm" `
-B ".\build" `
-G "Visual Studio 17 2022" `
-G "Visual Studio ${{ matrix.config.version }} ${{ matrix.config.year }}" `
-Thost=x64 `
-A x64 `
-DLLVM_ENABLE_PROJECTS="lld;clang" `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_INSTALL_PREFIX=".\install"
cmake --build .\build --target INSTALL --config Release -j
7z a -mx9 "LLVM-${{ env.llvm_version }}-win64.7z" ".\install\*"
7z a -mx9 "LLVM-${{ env.llvm_version }}-win64-${{ matrix.config.name }}.7z" ".\install\*"


- name: Upload artifacts
uses: actions/[email protected]
uses: actions/upload-artifact@v3
with:
name: LLVM-${{ env.llvm_version }}-win64-${{ matrix.config.name }}
path: LLVM-${{ env.llvm_version }}-win64-${{ matrix.config.name }}.7z

publish:
needs: build
runs-on: ubuntu-latest
env:
llvm_version: 14.0.6
default: msvc17
steps:
- name: Dowload the default package
uses: actions/dowload-artifact@v3
with:
name: LLVM-${{ env.llvm_version }}-win64-${{ env.default }}
- shell: bash
run: |
mv LLVM-${{ env.llvm_version }}-win64-${{ env.default }}.7z ${{ env.llvm_version }}-win64.7z

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: LLVM-${{ env.llvm_version }}-win64
path: LLVM-${{ env.llvm_version }}-win64.7z