forked from analogdevicesinc/libsmu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
500 lines (439 loc) · 27.4 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
os: Visual Studio 2015
clone_depth: 1
#init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
environment:
MSYSTEM: MINGW64
# Tell msys2 to inherit the current directory when starting the shell
CHERE_INVOKING: 1
configuration:
- Release
- Debug
branches:
except:
- gh-pages
- travis-ci
- coverity_scan
matrix:
fast_finish: true
install:
# 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
# see https://github.com/libusb/libusb/issues/86
- ps: pushd "C:\libusb"
- git checkout hotplug
- msbuild msvc\libusb_2015.sln /p:Platform=Win32 /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild msvc\libusb_2015.sln /p:Platform=x64 /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- ps: popd
# build 32-bit version of libsmu -- python bindings are built separately
- 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\\Release\\lib\\libusb-1.0.lib" \
-DLIBUSB_INCLUDE_DIRS="C:\\libusb\\libusb" \
-DBOOST_ROOT="C:\\Libraries\\boost_1_62_0" \
-DBOOST_LIBRARYDIR="C:\\Libraries\\boost_1_62_0\\lib32-msvc-14.0" \
-DBoost_USE_STATIC_LIBS=ON \
-DBUILD_STATIC_LIB=ON \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTS=ON \
-DBUILD_PYTHON=OFF \
..
- cmake --build . --config %CONFIGURATION%
# set LIBSMU_VERSION to current project version determined by cmake
- ps: Set-AppveyorBuildVariable -Name LIBSMU_VERSION -Value (get-content .version)
# build 64-bit version of libsmu -- python bindings are built separately
- 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\\Release\\lib\\libusb-1.0.lib" \
-DLIBUSB_INCLUDE_DIRS="C:\\libusb\\libusb" \
-DBOOST_ROOT="C:\\Libraries\\boost_1_62_0" \
-DBOOST_LIBRARYDIR="C:\\Libraries\\boost_1_62_0\\lib64-msvc-14.0" \
-DBoost_USE_STATIC_LIBS=ON \
-DBUILD_STATIC_LIB=ON \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTS=ON \
-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
- mkdir c:\libsmu\src
- mkdir c:\libsmu\include
- mkdir c:\libsmu\include\libsmu
# bundle a copy of the sources for debugging/traceback purposes
- xcopy c:\projects\libsmu\src c:\libsmu\src /E /H /K
# headers
- copy ..\include\libsmu\*.hpp c:\libsmu\include\libsmu
- copy "C:\\libusb\\libusb\libusb.h" c:\libsmu\include\libsmu
# drivers
- copy ..\dist\m1k-winusb.inf c:\libsmu\drivers
- copy ..\dist\m1k-winusb.cat c:\libsmu\drivers
- if not exist "c:\libsmu\drivers\amd64" mkdir c:\libsmu\drivers\amd64
- copy ..\dist\amd64\* c:\libsmu\drivers\amd64
- if not exist "c:\libsmu\drivers\x86" mkdir c:\libsmu\drivers\x86
- copy ..\dist\x86\* c:\libsmu\drivers\x86
# libraries
- copy C:\\libusb\\Win32\\Release\\lib\\libusb-1.0.* c:\libsmu\32
- copy C:\\libusb\\Win32\\Release\\dll\\libusb-1.0.* c:\libsmu\32
- copy C:\\libusb\\x64\\Release\\lib\\libusb-1.0.* c:\libsmu\64
- copy C:\\libusb\\x64\\Release\\dll\\libusb-1.0.* c:\libsmu\64
- copy ..\32\src\%CONFIGURATION%\libsmu.* c:\libsmu\32
- copy ..\64\src\%CONFIGURATION%\libsmu.* c:\libsmu\64
# gtest libraries for test executables
- ps: |
if (Test-Path "..\32\googletest-build\googlemock\gtest\Release\gtest.*") { copy ..\32\googletest-build\googlemock\gtest\Release\gtest.* c:\libsmu\32 }
if (Test-Path "..\64\googletest-build\googlemock\gtest\Release\gtest.*") { copy ..\64\googletest-build\googlemock\gtest\Release\gtest.* c:\libsmu\64 }
if (Test-Path "..\32\googletest-build\googlemock\gtest\Debug\gtestd.*") { copy ..\32\googletest-build\googlemock\gtest\Debug\gtestd.* c:\libsmu\32 }
if (Test-Path "..\64\googletest-build\googlemock\gtest\Debug\gtestd.*") { copy ..\64\googletest-build\googlemock\gtest\Debug\gtestd.* c:\libsmu\64 }
# executables including examples and tests
- copy ..\32\src\cli\%CONFIGURATION%\smu.exe c:\libsmu\32
- copy ..\64\src\cli\%CONFIGURATION%\smu.exe c:\libsmu\64
- copy ..\32\examples\%CONFIGURATION%\*.exe c:\libsmu\32
- copy ..\64\examples\%CONFIGURATION%\*.exe c:\libsmu\64
- copy ..\32\tests\%CONFIGURATION%\*.exe c:\libsmu\32
- copy ..\64\tests\%CONFIGURATION%\*.exe c:\libsmu\64
# batch file to run test suite
- copy ..\tests\run-tests.bat c:\libsmu\32
- copy ..\tests\run-tests.bat c:\libsmu\64
# windows specific redistributable libraries
- 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.OPENMP\\vcomp140.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.OPENMP\\vcomp140.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
- copy "C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\DLLs\\x86\\*" c:\libsmu\32
- copy "C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\DLLs\\x64\\*" c:\libsmu\64
- 7z a "c:\libsmu-%LIBSMU_VERSION%.zip" c:\libsmu
- appveyor PushArtifact c:\libsmu-%LIBSMU_VERSION%.zip
# build 32 and 64 bit pysmu modules for all supported python versions, currently 2.7, 3.4, and 3.5
# TODO: drop the duplication and loop over supported python versions
- mkdir c:\libsmu-python
## build 32 bit python2.7 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
- "c:/python27/python.exe -m pip install --only-binary :all: --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "c:/python27/python.exe -m pip install --only-binary :all: wheel"
# cython is required for generating the extensions
- "c:/python27/python.exe -m pip install --only-binary :all: cython"
# 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 --compiler=msvc -L ../../32/src/%CONFIGURATION% -I C:\\libusb\\libusb"
- "python setup.py build"
- "python setup.py bdist_wheel --skip-build"
- "python setup.py bdist --skip-build --format zip"
- "python setup.py bdist --skip-build --format msi"
# test local install
- ps: Get-ChildItem dist/*-cp27-*-win32.whl | % { pip install "$_" }
# Create a folder to keep pysmu for all the python versions
- mkdir "pysmu-%LIBSMU_VERSION%.win32-py"
- 7z x -y "c:\projects\libsmu\bindings\python\dist\pysmu*win32.zip" -o"c:\projects\libsmu\bindings\python\pysmu-%LIBSMU_VERSION%.win32-py"
## build 32 bit python3.4 bindings
# add python dirs to PATH
- set PATH=C:\\Python34;C:\\Python34\\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
- "c:/python34/python.exe -m pip install --only-binary :all: --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "c:/python34/python.exe -m pip install --only-binary :all: wheel"
# cython is required for generating the extensions
- "c:/python34/python.exe -m pip install --only-binary :all: cython"
# py2exe required to build exe from pysmu script
- "c:/python34/python.exe -m pip install --only-binary :all: py2exe"
- "c:/python34/python.exe -m pip install pyreadline"
- "vcvarsall.bat x86"
- "python setup.py build_ext --compiler=msvc -L ../../32/src/%CONFIGURATION% -I C:\\libusb\\libusb"
- "python setup.py build"
- "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"
# test local install
- ps: Get-ChildItem dist/*-cp34-*-win32.whl | % { pip install "$_" }
# build exe from python script
- "build_exe -b 0 -d exe32 bin/pysmu"
- rmdir /q /s bin\__pycache__
- 7z x -y "c:\projects\libsmu\bindings\python\dist\pysmu*win32.zip" -o"c:\projects\libsmu\bindings\python\pysmu-%LIBSMU_VERSION%.win32-py"
## build 32 bit python3.5 bindings
# add python dirs to PATH
- set PATH=C:\\Python35;C:\\Python35\\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
- "c:/python35/python.exe -m pip install --only-binary :all: --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "c:/python35/python.exe -m pip install --only-binary :all: wheel"
# cython is required for generating the extensions
- "c:/python35/python.exe -m pip install --only-binary :all: cython"
- "vcvarsall.bat x86"
- "python setup.py build_ext --compiler=msvc -L ../../32/src/%CONFIGURATION% -I C:\\libusb\\libusb"
- "python setup.py build"
- "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"
# test local install
- ps: Get-ChildItem dist/*-cp35-*-win32.whl | % { pip install "$_" }
- 7z x -y "c:\projects\libsmu\bindings\python\dist\pysmu*win32.zip" -o"c:\projects\libsmu\bindings\python\pysmu-%LIBSMU_VERSION%.win32-py"
- 7z a -y "c:\projects\libsmu\bindings\python\dist\pysmu-%LIBSMU_VERSION%.win32-py.zip" pysmu-*win32-py
- C:\msys64\usr\bin\bash -lc "rm dist/pysmu*win32.zip"
## build 64 bit python2.7 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
- "c:/python27-x64/python.exe -m pip install --only-binary :all: --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "c:/python27-x64/python.exe -m pip install --only-binary :all: wheel"
# cython is required for generating the extensions
- "c:/python27-x64/python.exe -m pip install --only-binary :all: cython"
- "vcvarsall.bat x64"
- "python setup.py build_ext --compiler=msvc -L ../../64/src/%CONFIGURATION% -I C:\\libusb\\libusb"
- "python setup.py build"
- "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"
# test local install
- ps: Get-ChildItem dist/*-cp27-*-win_amd64.whl | % { pip install "$_" }
# Create a folder to keep pysmu for all the python versions
- mkdir "pysmu-%LIBSMU_VERSION%.win-amd64-py"
- 7z x -y "c:\projects\libsmu\bindings\python\dist\pysmu*win-amd64.zip" -o"c:\projects\libsmu\bindings\python\pysmu-%LIBSMU_VERSION%.win-amd64-py"
## build 64 bit python3.4 bindings
# add python dirs to PATH
- set PATH=C:\\python34-x64;C:\\python34-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
- "c:/python34-x64/python.exe -m pip install --only-binary :all: --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "c:/python34-x64/python.exe -m pip install --only-binary :all: wheel"
# cython is required for generating the extensions
- "c:/python34-x64/python.exe -m pip install --only-binary :all: cython"
# py2exe required to build exe from pysmu script
- "c:/python34-x64/python.exe -m pip install --only-binary :all: py2exe"
- "c:/python34-x64/python.exe -m pip install pyreadline"
- "vcvarsall.bat x64"
- "python setup.py build_ext --compiler=msvc -L ../../64/src/%CONFIGURATION% -I C:\\libusb\\libusb"
- "python setup.py build"
- "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"
# test local install
- ps: Get-ChildItem dist/*-cp34-*-win_amd64.whl | % { pip install "$_" }
# build exe from python script
- "build_exe -b 0 -d exe64 bin/pysmu"
- rmdir /q /s bin\__pycache__
- 7z x -y "c:\projects\libsmu\bindings\python\dist\pysmu*win-amd64.zip" -o"c:\projects\libsmu\bindings\python\pysmu-%LIBSMU_VERSION%.win-amd64-py"
## build 64 bit python3.5 bindings
# add python dirs to PATH
- set PATH=C:\\python35-x64;C:\\python35-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
- "c:/python35-x64/python.exe -m pip install --only-binary :all: --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "c:/python35-x64/python.exe -m pip install --only-binary :all: wheel"
# cython is required for generating the extensions
- "c:/python35-x64/python.exe -m pip install --only-binary :all: cython"
- "vcvarsall.bat x64"
- "python setup.py build_ext --compiler=msvc -L ../../64/src/%CONFIGURATION% -I C:\\libusb\\libusb"
- "python setup.py build"
- "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"
# test local install
- ps: Get-ChildItem dist/*-cp35-*-win_amd64.whl | % { pip install "$_" }
- 7z x -y "c:\projects\libsmu\bindings\python\dist\pysmu*win-amd64.zip" -o"c:\projects\libsmu\bindings\python\pysmu-%LIBSMU_VERSION%.win-amd64-py"
- 7z a -y "c:\projects\libsmu\bindings\python\dist\pysmu-%LIBSMU_VERSION%.win-amd64-py.zip" pysmu-*win-amd64-py
- C:\msys64\usr\bin\bash -lc "rm dist/pysmu*win-amd64.zip"
# push all dist files as artifacts
- ps: Get-ChildItem dist/.\* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
# push pysmu binaries as artifacts
- ren exe32\pysmu.exe pysmu32.exe
- ren exe64\pysmu.exe pysmu64.exe
- appveyor PushArtifact exe32\pysmu32.exe
- appveyor PushArtifact exe64\pysmu64.exe
# copy python binding MSIs for installer
- ps: Copy-Item dist\pysmu-*amd64-py2.7.msi c:\libsmu-python\pysmu27-amd64.msi
- ps: Copy-Item dist\pysmu-*win32-py2.7.msi c:\libsmu-python\pysmu27-win32.msi
- ps: Copy-Item dist\pysmu-*amd64-py3.4.msi c:\libsmu-python\pysmu34-amd64.msi
- ps: Copy-Item dist\pysmu-*win32-py3.4.msi c:\libsmu-python\pysmu34-win32.msi
- ps: Copy-Item dist\pysmu-*amd64-py3.5.msi c:\libsmu-python\pysmu35-amd64.msi
- ps: Copy-Item dist\pysmu-*win32-py3.5.msi c:\libsmu-python\pysmu35-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
- ren C:\libsmu-setup-x86.exe libsmu-%LIBSMU_VERSION%-setup-x86.exe
- ren C:\libsmu-setup-x64.exe libsmu-%LIBSMU_VERSION%-setup-x64.exe
- appveyor PushArtifact C:\libsmu-%LIBSMU_VERSION%-setup-x86.exe
- appveyor PushArtifact C:\libsmu-%LIBSMU_VERSION%-setup-x64.exe
##### MinGW build
- set OPT_PATH=C:\msys64\mingw32\bin;C:\msys64\mingw64\bin;
- set PATH=%OPT_PATH%%PATH%
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syu"
# Install MinGW dependencies for 32 bit
- C:\msys64\usr\bin\bash -lc "pacman -Rs --noconfirm mingw-w64-i686-gcc-ada mingw-w64-i686-gcc-fortran mingw-w64-i686-gcc-libgfortran mingw-w64-i686-gcc-objc"
- C:\msys64\usr\bin\bash -lc "rm /mingw32/etc/gdbinit"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-pkg-config mingw-w64-i686-python2-pip mingw-w64-i686-openblas mingw-w64-i686-lapack"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-i686-python3 mingw-w64-i686-python3-pip mingw-w64-i686-binutils mingw-w64-i686-curl"
# Install MinGW dependencies for 64 bit
- C:\msys64\usr\bin\bash -lc "pacman -Rs --noconfirm mingw-w64-x86_64-gcc-ada mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-gcc-libgfortran mingw-w64-x86_64-gcc-objc"
- C:\msys64\usr\bin\bash -lc "rm /mingw64/etc/gdbinit"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-pkg-config mingw-w64-x86_64-python2-pip mingw-w64-x86_64-openblas mingw-w64-x86_64-lapack"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-pip mingw-w64-x86_64-binutils mingw-w64-x86_64-curl"
# Get libusb hotplug for 32 bit
- ps: (new-object System.Net.WebClient).Downloadfile("http://swdownloads.analog.com/cse/build/libusb-1.0-hp.7z", "c:\libusb.7z")
- 7z x -y "c:\libusb.7z" -o"C:\libusb-mingw" > nul
# Compile libusb hotplug for 64 bit
- git clone --branch=hotplug https://github.com/analogdevicesinc/libusb.git "C:\libusb-mingw64"
- C:\msys64\usr\bin\bash -lc "cd C:/libusb-mingw64 && ./autogen.sh && ./configure --prefix=/mingw64 --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 && make -j4"
# Build libsmu MinGW 32 bit
- echo "Running cmake for MinGW 32..."
- mkdir c:\projects\libsmu\mingw-32
- C:\msys64\usr\bin\bash -lc "cd C:/projects/libsmu/mingw-32 && cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=/mingw32 -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_C_COMPILER:FILEPATH=/mingw32/bin/i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=/mingw32/bin/i686-w64-mingw32-g++.exe -DLIBUSB_LIBRARIES=C:/libusb-mingw/MinGW32/static/libusb-1.0.a -DLIBUSB_INCLUDE_DIRS=C:/libusb-mingw/include/libusb-1.0 -DBoost_USE_STATIC_LIBS=ON -DBUILD_STATIC_LIB=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DBOOST_ROOT=C:/Libraries/boost_1_62_0 -DBUILD_PYTHON=OFF .. && cmake --build . --config %CONFIGURATION%"
# Build libsmu MinGW 64 bit
- echo "Running cmake for MinGW 64..."
- mkdir c:\projects\libsmu\mingw-64
- C:\msys64\usr\bin\bash -lc "cd C:/projects/libsmu/mingw-64 && cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=/mingw64 -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_C_COMPILER:FILEPATH=/mingw64/bin/x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=/mingw64/bin/x86_64-w64-mingw32-g++.exe -DLIBUSB_LIBRARIES=C:/libusb-mingw64/libusb/.libs/libusb-1.0.a -DLIBUSB_INCLUDE_DIRS=C:/libusb-mingw64/libusb -DBoost_USE_STATIC_LIBS=ON -DBUILD_STATIC_LIB=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DBOOST_ROOT=C:/Libraries/boost_1_62_0 -DBUILD_PYTHON=OFF .. && cmake --build . --config %CONFIGURATION%"
# Create libsmu zip artifact for 32 bit
- mkdir c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- mkdir c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers
- copy c:\projects\libsmu\include\libsmu\libsmu.hpp c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- copy c:\projects\libsmu\dist\m1k-winusb.inf c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers
- copy c:\projects\libsmu\dist\m1k-winusb.cat c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers
- if not exist "c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers\amd64" mkdir c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers\amd64
- copy C:\projects\libsmu\dist\amd64\* c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers\amd64
- if not exist "c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers\x86" mkdir c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers\x86
- copy C:\projects\libsmu\dist\x86\* c:\libsmu-%LIBSMU_VERSION%-MinGW-win32\drivers\x86
- copy c:\projects\libsmu\mingw-32\src\libsmu.* c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- copy c:\projects\libsmu\mingw-32\src\cli\smu.exe c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
# gtest libraries for test executables
#- copy c:\projects\libsmu\mingw-32\googletest-build\googlemock\gtest\libgtest* c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- copy c:\projects\libsmu\mingw-32\bin\libgtest* c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- copy c:\projects\libsmu\mingw-32\lib\libgtest* c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- copy c:\projects\libsmu\mingw-32\examples\*.exe c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- copy c:\projects\libsmu\mingw-32\tests\*.exe c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
# batch file to run test suite
- copy c:\projects\libsmu\tests\run-tests.bat c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- copy c:\libusb-mingw\MinGW32\static\libusb-1.0.a c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- C:\msys64\usr\bin\bash -lc "cd c:/msys64/mingw32/bin ; cp -r libwinpthread-*.dll libgcc_*.dll libstdc++-*.dll libgomp-*.dll c:/libsmu-%LIBSMU_VERSION%-MinGW-win32"
- 7z a "c:\libsmu-%LIBSMU_VERSION%-MinGW-win32.zip" c:\libsmu-%LIBSMU_VERSION%-MinGW-win32
- appveyor PushArtifact c:\libsmu-%LIBSMU_VERSION%-MinGW-win32.zip
# Create libsmu zip artifact for 64 bit
- mkdir c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- mkdir c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers
- copy c:\projects\libsmu\include\libsmu\libsmu.hpp c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- copy c:\projects\libsmu\dist\m1k-winusb.inf c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers
- copy c:\projects\libsmu\dist\m1k-winusb.cat c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers
- if not exist "c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers\amd64" mkdir c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers\amd64
- copy C:\projects\libsmu\dist\amd64\* c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers\amd64
- if not exist "c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers\x86" mkdir c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers\x86
- copy C:\projects\libsmu\dist\x86\* c:\libsmu-%LIBSMU_VERSION%-MinGW-win64\drivers\x86
- copy c:\projects\libsmu\mingw-64\src\libsmu.* c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- copy c:\projects\libsmu\mingw-64\src\cli\smu.exe c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
# gtest libraries for test executables
#- copy c:\projects\libsmu\mingw-64\googletest-build\googlemock\gtest\libgtest* c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- copy c:\projects\libsmu\mingw-64\bin\libgtest* c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- copy c:\projects\libsmu\mingw-64\lib\libgtest* c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- copy c:\projects\libsmu\mingw-64\examples\*.exe c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- copy c:\projects\libsmu\mingw-64\tests\*.exe c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
# batch file to run test suite
- copy c:\projects\libsmu\tests\run-tests.bat c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- copy c:\libusb-mingw64\libusb\.libs\libusb-1.0.a c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- C:\msys64\usr\bin\bash -lc "cd c:/msys64/mingw64/bin ; cp -r libwinpthread-*.dll libgcc_*.dll libstdc++-*.dll libgomp-*.dll c:/libsmu-%LIBSMU_VERSION%-MinGW-win64"
- 7z a "c:\libsmu-%LIBSMU_VERSION%-MinGW-win64.zip" c:\libsmu-%LIBSMU_VERSION%-MinGW-win64
- appveyor PushArtifact c:\libsmu-%LIBSMU_VERSION%-MinGW-win64.zip
### Prepare for python bindings
## build 32 bit python 2.7 bindings
- "python2 --version"
- "python2 -c \"import struct; print(struct.calcsize('P') * 8)\""
# update pip to keep it from complaining
- "C:/msys64/mingw32/bin/python2.exe -m pip install --only-binary :all: --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
- "C:/msys64/mingw32/bin/python2.exe -m pip install --only-binary :all: wheel"
# cython is required for generating the extensions
- "C:/msys64/mingw32/bin/python2.exe -m pip install cython"
# build python dist files
- cd C:\projects\libsmu\bindings\python
- "python2 setup.py build_ext --compiler=mingw32 -L C:\\projects\\libsmu\\mingw-32\\src -I C:\\libusb-mingw\\include\\libusb-1.0"
- "python2 setup.py build"
- "python2 setup.py bdist_wheel --skip-build"
- "python2 setup.py bdist --skip-build --format msi"
- ps: $PWD = Convert-Path .
- ps: $PWD = $PWD + "\build-temp"
- ps: $PWD
- ps: $PWD = ($PWD -replace "\\","/").Trim("/")
- ps: $PWD
- ps: $env:PWDD=$PWD
- "python2 setup.py bdist --format zip --bdist-base=%PWDD%"
# test local install
- ps: Get-ChildItem dist/*-cp27-*-mingw.whl | % { pip2 install "$_" }
# Create a folder to keep pysmu for all the python versions
- mkdir "pysmu-%LIBSMU_VERSION%-mingw-py"
- 7z x -y "c:\projects\libsmu\bindings\python\dist\pysmu*mingw.zip" -o"c:\projects\libsmu\bindings\python\pysmu-%LIBSMU_VERSION%-mingw-py"
## build 32 bit python 3.6 bindings
#- set PATH=C:\\msys64\\mingw32\\lib\\python3.6;C:\\msys64\\mingw32\\lib\\python3.6\\Tools\\scripts;%PATH%
#- "python3 --version"
#- "python3 -c \"import struct; print(struct.calcsize('P') * 8)\""
# update pip to keep it from complaining
#- "C:/msys64/mingw32/bin/python3.exe -m pip install --only-binary :all: --disable-pip-version-check --user --upgrade pip"
# wheel needs to be installed in order to build binary wheels for pysmu
#- "C:/msys64/mingw32/bin/python3.exe -m pip install --only-binary :all: wheel"
# cython is required for generating the extensions
#- "C:/msys64/mingw32/bin/python3.exe -m pip install cython"
# build python dist files
- cd C:\projects\libsmu\bindings\python
#- "python3 setup.py build_ext --compiler=mingw32 -L C:\\projects\\libsmu\\mingw-32\\src -I C:\\libusb-mingw\\include\\libusb-1.0"
#- "python3 setup.py build"
#- "python3 setup.py bdist_wheel --skip-build"
#- "python3 setup.py bdist --skip-build --format msi"
#- "python3 setup.py bdist --format zip --bdist-base=%PWDD%"
# test local install
#- ps: Get-ChildItem dist/*-cp36-*-mingw.whl | % { pip3 install "$_" }
# Create a folder to keep pysmu for all the python versions
#- 7z x -y "c:\projects\libsmu\bindings\python\dist\pysmu*mingw.zip" -o"c:\projects\libsmu\bindings\python\pysmu-%LIBSMU_VERSION%-mingw-py"
- 7z a -y "c:\projects\libsmu\bindings\python\dist\pysmu-%LIBSMU_VERSION%-mingw-py.zip" pysmu-*mingw-py
- C:\msys64\usr\bin\bash -lc "rm dist/pysmu*mingw.zip"
# push all dist files as artifacts
- ps: Get-ChildItem dist/.\* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
cache:
# cache innosetup download
- C:\Users\appveyor\AppData\Local\Temp\chocolatey
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))