forked from AcademySoftwareFoundation/OpenShadingLanguage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
196 lines (159 loc) · 8.55 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
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:\Program Files\LLVM
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:\Program Files\LLVM\bin"
#$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 = "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" -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;$DEP_DIR;$BOOST_ROOT;$LLVM_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DLLVM_DIRECTORY="$LLVM_DIR" -DLLVM_STATIC=ON -DOpenImageIO_ROOT="$env:OpenImageIO_ROOT" -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 -DBUILD_SHARED_LIBS=ON -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 = "$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\lib;$env:OpenImageIO_ROOT\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'))