Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #26 from jsmall-nvidia/feature/vs2019
Browse files Browse the repository at this point in the history
Specify Visual Studio 2019
  • Loading branch information
jsmall-zzz authored Sep 23, 2022
2 parents 337e7f0 + df01c9d commit 4360641
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: windows-latest
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# We use windows-2019 so we have Visual Studio 2019
runs-on: windows-2019

# On github actions doing 'Debug', 'RelWithDebInfo' results in resource usage > 30Gb
# That github actions virtual machine runners
Expand Down Expand Up @@ -48,6 +50,9 @@ jobs:
#
# TODO(JS): AARCH64 target is only available as 'experimental'
# TODO(JS): We really need to select -Thost based on what we are on, really we only need for 64bit windows.
# Generators for cmake:
# https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#command-line-build-tool-generators

run: cmake llvm -B ${{github.workspace}}/build-${{matrix.platform}} -A ${{matrix.platform}} -Thost=x64 -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="X86;ARM" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AArch64" -DCLANG_BUILD_TOOLS=0 -DCLANG_ENABLE_STATIC_ANALYZER=0 -DCLANG_ENABLE_ARCMT=0 -DCLANG_INCLUDE_DOCS=0 -DCLANG_INCLUDE_TESTS=0 -DLLVM_BUILD_LLVM_C_DYLIB=0 -DLLVM_INCLUDE_BENCHMARKS=0 -DLLVM_INCLUDE_DOCS=0 -DLLVM_INCLUDE_EXAMPLES=0 -DLLVM_BUILD_TOOLS=1 -DLLVM_INCLUDE_TESTS=0 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_MINSIZEREL=MT -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_CRT_RELWITHDEBINFO=MT

- name: Build
Expand Down
101 changes: 101 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Windows CI Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
name: Release Build
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# We use windows-2019 so we have Visual Studio 2019
runs-on: windows-2019

# On github actions doing 'Debug', 'RelWithDebInfo' results in resource usage > 30Gb
# That github actions virtual machine runners
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# Runners only have 14Gb SSD, so the build can't complete.

strategy:
matrix:
# Might be useful to have all these combinations but for now don't build on github Actions, so use limited subset
# configuration: ['Release', 'Debug', 'RelWithDebInfo']
# TODO(JS): It looks like CMake project is not set for building `aarch64` on Visual Studio, as breaks during CMake project stage.
# platform: ['x64', 'Win32', 'aarch64' ]
configuration: ['Release']
platform: ['Win32', 'x64']

steps:
- uses: actions/checkout@v2.3.4
with:
submodules: 'true'
fetch-depth: '0'

- name: Configure CMake
# Configure CMake in a 'build'-platform subdirectory.
#
# Configured this way because came across information claiming for windows builds have to be in
# different directories when for different platforms.
#
# TODO(JS): AARCH64 target is only available as 'experimental'
# TODO(JS): We really need to select -Thost based on what we are on, really we only need for 64bit windows.

run: cmake llvm -B ${{github.workspace}}/build-${{matrix.platform}} -A ${{matrix.platform}} -Thost=x64 -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="X86;ARM" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AArch64" -DCLANG_BUILD_TOOLS=0 -DCLANG_ENABLE_STATIC_ANALYZER=0 -DCLANG_ENABLE_ARCMT=0 -DCLANG_INCLUDE_DOCS=0 -DCLANG_INCLUDE_TESTS=0 -DLLVM_BUILD_LLVM_C_DYLIB=0 -DLLVM_INCLUDE_BENCHMARKS=0 -DLLVM_INCLUDE_DOCS=0 -DLLVM_INCLUDE_EXAMPLES=0 -DLLVM_BUILD_TOOLS=1 -DLLVM_INCLUDE_TESTS=0 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_MINSIZEREL=MT -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_CRT_RELWITHDEBINFO=MT

- name: Build
run:
cmake --build ${{github.workspace}}/build-${{matrix.platform}} --config ${{matrix.configuration}}

- name: archive
id: archive

# TODO(JS):
# At the moment each archive holds includes and binaries. It could be argued to separate the
# includes that stay the same between archives be saved on its own. This would lead to less space being
# required.
#
# In that scenario we could have an action for a 'release' which just saved off headers, and then
# not bother for the binary packages.
run: |
echo "achiving files..."
if ("${{matrix.platform}}" -eq "x64")
{
$PLATFORM_NAME = "win64"
}
elseif ("${{matrix.platform}}" -eq "aarch64")
{
$PLATFORM_NAME = "win-aarch64"
}
else
{
$PLATFORM_NAME = "win32"
}
LLVM_VERSION=`git log --pretty=format:'%h' -n 1`
$binArchive = "llvm-$LLVM_VERSION-$PLATFORM_NAME-${{matrix.configuration}}.zip"
echo "name=BINARY_ARCHIVE::$binArchive"
echo "::set-output name=BINARY_ARCHIVE::$binArchive"
7z a "$binArchive" README.md
7z a "$binArchive" -r llvm/include/
7z a "$binArchive" -r clang/include/
7z a "$binArchive" -r build-${{matrix.platform}}/include/
7z a "$binArchive" -r build-${{matrix.platform}}/tools/clang/include/clang/
7z a "$binArchive" -r build-${{matrix.platform}}/${{matrix.configuration}}/lib/
7z a "$binArchive" build-${{matrix.platform}}/${{matrix.configuration}}/bin/llvm-config.exe
- uses: actions/upload-artifact@v3
with:
name: llvm-build-${{matrix.configuration}}-${{matrix.platform}}
path: |
${{ steps.archive.outputs.BINARY_ARCHIVE }}

0 comments on commit 4360641

Please sign in to comment.