Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
197 lines (159 sloc) 8.57 KB
clone_depth: 10
version: '{branch}-{build}'
# Disable Appveyor's test discovery which is not used
test: off
branches:
only:
- master
- release
- appveyor
- /RB-/
- /lg-/
skip_tags: true
build:
parallel: true
verbosity: detailed
platform:
- x64
# - x86
configuration:
#- Debug
- Release
environment:
matrix:
- TOOLSET: msvc14
os:
- Visual Studio 2015
cache:
- C:\projects\OSLdeps -> appveyor.yml
# The -> means that the cache dir is discarded if appveyor.yml has changed
before_build:
- ps: |
$OSL_INSTALL_BEGIN=Get-Date
Write-Output "Configuration: $env:CONFIGURATION"
Write-Output "Platform: $env:PLATFORM"
ls C:\Libraries\llvm-5.0.0
Get-ChildItem Env:
[Array]$OSL_BUILD_FLAGS = "--", "/nologo", "/verbosity:minimal";
$DWN_DIR = "C:\projects\OSLdownloads"
$DEP_DIR = "C:\projects\OSLdeps"
$BOOST_ROOT = "C:\Libraries\boost_1_69_0"
$PYTHON_DIR = "C:\Python27"
$LLVM_DIR = "C:\Libraries\llvm-5.0.0"
#$LLVM_DIR = "$DEP_DIR"
$env:Path += ";$DEP_DIR\lib;$DEP_DIR\bin"
$OSL_INT_DIR = "build\windows$env:PLATFORM"
# RDP into the build-bot to try some stuff out
# iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# Choose the VisualStudio generator
$GENERATOR = switch ($env:TOOLSET)
{
"msvc14" {"Visual Studio 14 2015"}
"msvc12" {"Visual Studio 12 2013"}
"msvc11" {"Visual Studio 11 2012"}
"msvc10" {"Visual Studio 10 2010"}
}
# Final setup based on 64 or 32 bit
if ($env:PLATFORM -eq "x64") {
$GENERATOR = "$GENERATOR Win64"
$PYTHON_DIR = "$PYTHON_DIR-x64"
$BOOST_LIBRARYDIR = "$BOOST_ROOT\lib64-msvc-14.0"
} else {
$BOOST_LIBRARYDIR = "$BOOST_ROOT\lib32-msvc-14.0"
}
# Always create the download directory
md $DWN_DIR -Force | Out-Null;
# If the dependency directory exists/cached, use it
if(!(Test-Path -Path $DEP_DIR )){
md $DEP_DIR -Force | Out-Null; cd $DEP_DIR
md $DEP_DIR\include -Force | Out-Null; cd $DEP_DIR
md $DEP_DIR\lib -Force | Out-Null; cd $DEP_DIR
cd $DWN_DIR
nuget install libtiff-$env:TOOLSET-$env:PLATFORM-master -Version 4.0.6.85 -Source https://ci.appveyor.com/nuget/libtiff-i3h8tqqy7o7b
mv .\libtiff*\*.h $DEP_DIR\include\
mv .\libtiff*\*.lib $DEP_DIR\lib\
mv .\libtiff*\*.dll $DEP_DIR\lib\
nuget install libpng-$env:TOOLSET-$env:PLATFORM-master -Version 1.6.18.44 -Source https://ci.appveyor.com/nuget/libpng-7hwq4pmmrc48
mv .\libpng*\*.h $DEP_DIR\include\
mv .\libpng*\*.lib $DEP_DIR\lib\
mv .\libpng*\*.dll $DEP_DIR\lib\
nuget install libjpeg-$env:TOOLSET-$env:PLATFORM-master -Version 1.4.80.21 -Source https://ci.appveyor.com/nuget/libjpegturbo-o6k4js4y7pjw
mv .\libjpeg*\*.h $DEP_DIR\include\
mv .\libjpeg*\*.lib $DEP_DIR\lib\
mv .\libjpeg*\*.dll $DEP_DIR\lib\
nuget install freetype
mv .\freetype.2.8.0.1\build\native\include\* $DEP_DIR\include\
mv .\freetype.2.8.0.1\build\native\lib\$env:PLATFORM\v140\dynamic\$env:CONFIGURATION\*.lib $DEP_DIR\lib\
mv .\freetype.redist.2.8.0.1\build\native\bin\$env:PLATFORM\v140\dynamic\$env:CONFIGURATION\*.dll $DEP_DIR\lib\
# ZLib
cd $DWN_DIR
Start-FileDownload https://github.com/madler/zlib/archive/v1.2.8.tar.gz
tar -xzf v1.2.8.tar.gz; cd zlib-1.2.8; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR"
cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
# IlmBase
cd $DWN_DIR
Start-FileDownload http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.2.1.tar.gz
tar -xzf ilmbase-2.2.1.tar.gz ; cd ilmbase* ; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DCMAKE_CXX_FLAGS=" /W1 /EHsc /DWIN32=1 "
cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
# LLVM
# This shouldn't be necessary, we use the pre-installed LLVM
# cd $DWN_DIR
# git clone --depth 10 --branch release_40 https://github.com/llvm-mirror/llvm.git
# cd llvm; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
# cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DLLVM_TARGETS_TO_BUILD="X86"
# cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
# OpenEXR
cd $DWN_DIR
Start-FileDownload http://download.savannah.nongnu.org/releases/openexr/openexr-2.2.1.tar.gz
tar -xzf openexr-2.2.1.tar.gz ; cd openexr* ; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DILMBASE_PACKAGE_PREFIX="$DEP_DIR" -DCMAKE_CXX_FLAGS=" /W1 /EHsc /DWIN32=1 "
cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
}
# Always do this
cinst winflexbison
build_script:
- ps: |
# OpenImageIO
$env:OPENIMAGEIO_ROOT_DIR = "C:\projects\oiio"
$env:FREETYPE_DIR = "$DEP_DIR"
$FREETYPE_LIBRARY = "$DEP_DIR\lib\freetype28.lib"
cd $DWN_DIR
git clone --depth 10 https://github.com/OpenImageIO/oiio.git oiiosrc
cd .\oiiosrc; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_INSTALL_PREFIX="$env:OPENIMAGEIO_ROOT_DIR" -DCMAKE_PREFIX_PATH="$DEP_DIR;$BOOST_ROOT" -DBOOST_LIBRARYDIR="$BOOST_LIBRARYDIR" -DFREETYPE_LIBRARY="$FREETYPE_LIBRARY" -DUSE_PYTHON=OFF -DOIIO_BUILD_TESTS=OFF -DUSE_NUKE=OFF
cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
# Build OSL
cd $env:APPVEYOR_BUILD_FOLDER
md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$env:OPENIMAGEIO_ROOT_DIR;$DEP_DIR;$BOOST_ROOT;$LLVM_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DLLVM_DIRECTORY="$LLVM_DIR" -DLLVM_STATIC=ON -DOPENIMAGEIO_ROOT_DIR="$env:OPENIMAGEIO_ROOT_DIR" -DBOOST_LIBRARYDIR="$BOOST_LIBRARYDIR" -DFLEX_EXECUTABLE="C:\ProgramData\chocolatey\lib\winflexbison\tools\win_flex.exe" -DBISON_EXECUTABLE="C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe" -DUSE_QT=OFF -DBUILDSTATIC=OFF -DLINKSTATIC=OFF
# OSL's CMake should probably be handling Windows config better...
$OSL_BUILD_DIR = "$env:APPVEYOR_BUILD_FOLDER\$OSL_INT_DIR"
$env:OSL_ROOT_DIR = "$env:APPVEYOR_BUILD_FOLDER\src"
$env:OIIO_LIBRARY_PATH = "$OSL_BUILD_DIR\src\osl.imageio\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\oslc\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\oslinfo\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\liboslcomp\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\liboslexec\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\liboslnoise\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\liboslquery\$env:CONFIGURATION"
$env:Path += ";$env:OPENIMAGEIO_ROOT_DIR\lib;$env:OPENIMAGEIO_ROOT_DIR\bin"
$env:Path += ";$BOOST_LIBRARYDIR"
cmake --build . --config $env:CONFIGURATION $OSL_BUILD_FLAGS
$OSL_BUILD_END=Get-Date
if(($OSL_BUILD_END-$OSL_INSTALL_BEGIN).TotalMinutes -gt 50) {
# Change to appveyor.yml means the cache needs to be rebuilt leaving
# us with not enough time to run the tests.
echo "OSL tests skipped in favor of uploading dependency cache"
# Echo to build log and Appveyors message page
Add-AppveyorMessage -Message "OSL tests skipped in favor of uploading dependency cache" -Category Warning
} else {
# Test OSL
ctest -C $env:CONFIGURATION --output-on-failure
}
#init:
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
#on_failure:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
You can’t perform that action at this time.