Last active
August 30, 2018 18:57
-
-
Save EricWF/28b1e46fdecee9bb0219d5aa55293041 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# Appveyor configuration file for LLVM | |
# ----------------------------------------------------------------------------- | |
# This appveyor.yml is for the LLVM repository (Example: github.com/llvm-mirror/llvm) | |
# It builds LLVM, Clang, Clang tools extra, LLD. | |
############################################################################### | |
version: '{build}' | |
shallow_clone: true | |
build: | |
verbosity: detailed | |
configuration: | |
- Release | |
environment: | |
matrix: | |
########################################################################### | |
# Build x86 version using MSVC 2017 | |
########################################################################### | |
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | |
MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat | |
MSVC_SETUP_ARG: x86 | |
########################################################################### | |
# Build x64 version using MSVC 2017 | |
########################################################################### | |
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | |
MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat | |
MSVC_SETUP_ARG: x64 | |
########################################################################### | |
# Build 64 bit version using clang-cl backed by MSVC 2017 | |
# ------------------------------------------------------------------------- | |
# Note that building against MSVC 2017 is only supported with a newer clang | |
########################################################################### | |
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | |
MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat | |
MSVC_SETUP_ARG: x64 | |
USE_CLANG: ON | |
INSTALL_NEW_CLANG: ON | |
CLANG_URL: http://llvm.org/pre-releases/win-snapshots/LLVM-5.0.0-r301646-win64.exe | |
########################################################################### | |
# Build 32 bit version using clang-cl backed by MSVC 2017 | |
########################################################################### | |
# FIXME: This configuration currently doesn't work. | |
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | |
# MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat | |
# MSVC_SETUP_ARG: x86 | |
# USE_CLANG: ON | |
# INSTALL_NEW_CLANG: ON | |
# CLANG_URL: http://llvm.org/pre-releases/win-snapshots/LLVM-5.0.0-r301646-win64.exe | |
########################################################################### | |
# Build 64 bit version using clang-cl backed by MSVC 2015 | |
########################################################################### | |
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | |
MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat | |
MSVC_SETUP_ARG: x86_amd64 | |
USE_CLANG: ON | |
########################################################################### | |
# Build using MSVC 2015 | |
########################################################################### | |
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | |
MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat | |
MSVC_SETUP_ARG: x86_amd64 | |
install: | |
############################################################################# | |
# Setup Ninja and CMake dependencies | |
############################################################################# | |
- mkdir C:\projects\deps | |
- cd C:\projects\deps | |
# Setup A newer CMake | |
- set CMAKE_URL=https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.zip | |
- appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip | |
- 7z x cmake.zip -oC:\projects\deps > nul | |
- move C:\projects\deps\cmake-* C:\projects\deps\cmake | |
- set PATH=C:\projects\deps\cmake\bin;%PATH% | |
- cmake --version | |
# Setup Ninja | |
- set NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip | |
- appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip -FileName ninja.zip | |
- 7z x ninja.zip -oC:\projects\deps\ninja > nul | |
- set PATH=C:\projects\deps\ninja;%PATH% | |
- ninja --version | |
# Upgrade clang if necessary | |
- IF DEFINED INSTALL_NEW_CLANG appveyor DownloadFile %CLANG_URL% -FileName llvm-installer.exe | |
- IF DEFINED INSTALL_NEW_CLANG START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM" | |
before_build: | |
############################################################################ | |
# Download extra sources and place them in the right place under LLVM | |
# -------------------------------------------------------------------------- | |
# Replace the git repositories with the source versions you desire. It should | |
# all still work the same. | |
############################################################################ | |
- set LLVM_ROOT=%APPVEYOR_BUILD_FOLDER% | |
- set LLVM_GIT=http://llvm.org/git | |
- git clone --depth=1 %LLVM_GIT%/clang.git %LLVM_ROOT%\tools\clang | |
- git clone --depth=1 %LLVM_GIT%/clang-tools-extra.git %LLVM_ROOT%\tools\clang\tools\extra | |
- git clone --depth=1 %LLVM_GIT%/lld.git %LLVM_ROOT%\tools\lld | |
############################################################################# | |
# Setup MSVC Environment | |
############################################################################# | |
- call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG% | |
- cd %APPVEYOR_BUILD_FOLDER% | |
build_script: | |
- md C:\projects\build-llvm | |
- cd C:\projects\build-llvm | |
- echo %configuration% | |
- IF DEFINED USE_CLANG set PATH="C:\Program Files\LLVM\bin";%PATH% | |
- IF DEFINED USE_CLANG clang-cl -v | |
- IF DEFINED USE_CLANG set CMAKE_EXTRA_OPTIONS=-DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe | |
############################################################################# | |
# Configuration Step | |
# --------------------------------------------------------------------------- | |
# Optional CMake options: | |
# -DLLVM_ENABLE_ASSERTIONS=ON | |
# Turn on assertions within LLVM even in release mode. Very helpful | |
# for catching API misuses and problems. | |
# -DCMAKE_BUILD_TYPE=RELWITHDEBINFO | |
# Use this instead of "RELEASE" if you want the created libraries to | |
# have debug information. | |
############################################################################# | |
- cmake -G Ninja | |
"-DCMAKE_INSTALL_PREFIX=C:\Libraries" | |
"-DCMAKE_BUILD_TYPE=%configuration%" | |
"-DLLVM_INSTALL_UTILS=ON" | |
%CMAKE_EXTRA_OPTIONS% | |
%APPVEYOR_BUILD_FOLDER% | |
############################################################################# | |
# Build Step | |
- ninja | |
- ninja check-all # I wouldn't sweat a few failures here. This step is optional | |
- ninja install | |
on_failure: | |
- appveyor PushArtifact CMakeFiles/CMakeOutput.log | |
- appveyor PushArtifact CMakeFiles/CMakeError.log | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment