forked from analogdevicesinc/libsmu
-
Notifications
You must be signed in to change notification settings - Fork 2
/
appveyor.yml
141 lines (122 loc) · 5.59 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
os: Visual Studio 2015
clone_depth: 1
configuration:
- Release
- Debug
branches:
except:
- gh-pages
- travis-ci
install:
- ps: >-
If ($env:Configuration -Match "Debug") {
$env:PYTHON_DEBUG="-g"
} Else {
$env:PYTHON_DEBUG=""
}
# libusb patched for windows hotplug support
- git clone https://github.com/analogdevicesinc/libusb.git "C:\libusb"
# install innosetup for creating installers
- choco install InnoSetup
- set PATH=%PATH%;"C:\Program Files (x86)\Inno Setup 5"
build_script:
# build our own libusb version with hotplug support until upstream merges related patches
- ps: pushd "C:\libusb"
- git checkout hotplug
- msbuild msvc\libusb_2015.sln /p:Platform=Win32 /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild msvc\libusb_2015.sln /p:Platform=x64 /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- ps: popd
- mkdir c:\projects\libsmu\32
- cd c:\projects\libsmu\32
- cmake -G "Visual Studio 14 2015" \
-DCMAKE_BUILD_TYPE:STRING=%CONFIGURATION% \
-DCMAKE_SYSTEM_PREFIX_PATH="C:" \
-DLIBUSB_LIBRARIES="C:\\libusb\\Win32\\%CONFIGURATION%\\lib\\libusb-1.0.lib" \
-DLIBUSB_INCLUDE_DIRS="C:\\libusb\\libusb" \
-DBUILD_PYTHON=OFF \
..
- cmake --build . --config %CONFIGURATION%
- mkdir c:\projects\libsmu\64
- cd c:\projects\libsmu\64
- cmake -G "Visual Studio 14 2015 Win64" \
-DCMAKE_BUILD_TYPE:STRING=%CONFIGURATION% \
-DCMAKE_SYSTEM_PREFIX_PATH="C:" \
-DLIBUSB_LIBRARIES="C:\\libusb\\x64\\%CONFIGURATION%\\lib\\libusb-1.0.lib" \
-DLIBUSB_INCLUDE_DIRS="C:\\libusb\\libusb" \
-DBUILD_PYTHON=OFF \
..
- cmake --build . --config %CONFIGURATION%
# create libsmu zipfile
- mkdir c:\libsmu
- mkdir c:\libsmu\drivers
- mkdir c:\libsmu\32
- mkdir c:\libsmu\64
- copy ..\src\libsmu.hpp c:\libsmu
- copy ..\dist\m1k-winusb.inf c:\libsmu\drivers
- copy ..\dist\m1k-winusbx64.cat c:\libsmu\drivers
- copy ..\dist\m1k-winusbx86.cat c:\libsmu\drivers
- copy ..\32\src\%CONFIGURATION%\libsmu.* c:\libsmu\32
- copy ..\64\src\%CONFIGURATION%\libsmu.* c:\libsmu\64
- copy ..\32\src\cli\%CONFIGURATION%\smu.exe c:\libsmu\32
- copy ..\64\src\cli\%CONFIGURATION%\smu.exe c:\libsmu\64
- copy "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\redist\\x86\\Microsoft.VC140.CRT\\msvcp140.dll"; c:\libsmu\32
- copy "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\redist\\x86\\Microsoft.VC140.CRT\\vcruntime140.dll"; c:\libsmu\32
- copy "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\redist\\x64\\Microsoft.VC140.CRT\\msvcp140.dll"; c:\libsmu\64
- copy "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\redist\\x64\\Microsoft.VC140.CRT\\vcruntime140.dll"; c:\libsmu\64
- 7z a "c:\libsmu.zip" c:\libsmu
- appveyor PushArtifact c:\libsmu.zip
## build 32 bit python bindings
# add python dirs to PATH
- set PATH=C:\\Python27;C:\\Python27\\Scripts;%PATH%
# check we're using the right python version and arch
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# update pip to keep it from complaining
- "pip install --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "pip install wheel"
# build python dist files
- ps: pushd C:\projects\libsmu\bindings\python
- set DISTUTILS_USE_SDK=1
- set MSSdk=1
- set PATH=C:\Program Files (x86)\MSBuild\14.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC;%PATH%
- "vcvarsall.bat x86"
- "python setup.py build_ext %PYTHON_DEBUG% --compiler=msvc -L ../../32/src/%CONFIGURATION% -I C:\\libusb\\libusb"
- "python setup.py build %PYTHON_DEBUG%"
- "python setup.py bdist_wheel --skip-build"
- "python setup.py bdist --skip-build --format zip"
- "python setup.py bdist --skip-build --format msi"
## build 64 bit python bindings
# add python dirs to PATH
- set PATH=C:\\Python27-x64;C:\\Python27-x64\\Scripts;%PATH%
# check we're using the right python version and arch
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# update pip to keep it from complaining
- "pip install --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "pip install wheel"
- "vcvarsall.bat x64"
- "python setup.py build_ext %PYTHON_DEBUG% --compiler=msvc -L ../../64/src/%CONFIGURATION% -I C:\\libusb\\libusb"
- "python setup.py build %PYTHON_DEBUG%"
- "python setup.py bdist_wheel --skip-build"
- "python setup.py bdist --skip-build --format zip"
- "python setup.py bdist --skip-build --format msi"
- "python setup.py sdist"
# push all dist files as artifacts
- ps: Get-ChildItem dist/.\* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
# copy python binding MSIs for installer
- mkdir c:\libsmu-python
- ps: Copy-Item dist\pysmu-*amd64-py*.msi c:\libsmu-python\pysmu-amd64.msi
- ps: Copy-Item dist\pysmu-*win32-py*.msi c:\libsmu-python\pysmu-win32.msi
- ps: popd
# create libsmu installers
- copy C:\projects\libsmu\32\dist\libsmu-x86.iss C:\projects\libsmu\dist\libsmu-x86.iss
- copy C:\projects\libsmu\32\dist\libsmu-x64.iss C:\projects\libsmu\dist\libsmu-x64.iss
- iscc C:\projects\libsmu\dist\libsmu-x86.iss
- iscc C:\projects\libsmu\dist\libsmu-x64.iss
- appveyor PushArtifact C:\libsmu-setup-x86.exe
- appveyor PushArtifact C:\libsmu-setup-x64.exe
cache:
# cache innosetup download
- C:\Users\appveyor\AppData\Local\Temp\chocolatey