forked from analogdevicesinc/libiio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
184 lines (165 loc) · 11.9 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
version: '{branch}.{build}'
clone_depth: 1
skip_commits:
message: /(iiod|IIOD):.*/
environment:
# Tell msys2 to add mingw64 to the path
MSYSTEM: MINGW64
# Tell msys2 to inherit the current directory when starting the shell
CHERE_INVOKING: 1
configuration:
- Release
install:
- echo "Checking out sub-modules..."
- git submodule update --init
- echo "Downloading deps..."
- cd C:\
- appveyor DownloadFile http://swdownloads.analog.com/cse/build/libiio-win-deps.zip
- 7z x -y "C:\libiio-win-deps.zip"
#Install Inno Setup
- choco install InnoSetup
- set PATH=%PATH%;"C:\Program Files (x86)\Inno Setup 5"
build_script:
- set OLD_PATH=%PATH%
- set OPT_PATH=C:\msys64\mingw32\bin;C:\msys64\mingw64\bin;
- set PATH=%OPT_PATH%%PATH%
- set GENERATOR=Unix Makefiles
- set MINGW_TOOLCHAIN_VERSION=10.0.0-3
- set DOXYGEN_VERSION=1.8.18-1
- set GRAPHVIZ_VERSION=2.40.1-13
- cd C:\projects\libiio
- set folder-path=C:\projects\libiio\build-mingw-win32\%configuration%
# MinGW 32 bit
- echo "Running cmake for MinGW 32 bit... "
- mkdir C:\projects\libiio\build-mingw-win32
- cd C:\projects\libiio\build-mingw-win32
- C:\msys64\usr\bin\bash -lc "pwd"
- mkdir C:\projects\libiio\build-mingw-win32\"%configuration%"& cd C:\projects\libiio\build-mingw-win32\"%configuration%"
- C:\msys64\usr\bin\bash -lc "pwd"
# TODO: Revert this after appveyor supports the latest installer.
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -U http://repo.msys2.org/msys/x86_64/pacman-5.2.2-1-x86_64.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig"
- C:\msys64\usr\bin\bash -lc "pacman-key --verify msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz{.sig,}"
- C:\msys64\usr\bin\bash -lc "pacman-key --populate"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -U msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syu"
- 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-libusb mingw-w64-i686-curl mingw-w64-i686-cmake mingw-w64-i686-libxml2 mingw-w64-i686-pkg-config mingw-w64-i686-libzip"
# Newer llvm breaks doxygen, use old version for now
- C:\msys64\usr\bin\bash -lc "pacman -U --noconfirm http://repo.msys2.org/mingw/i686/mingw-w64-i686-llvm-%MINGW_TOOLCHAIN_VERSION%-any.pkg.tar.zst http://repo.msys2.org/mingw/i686/mingw-w64-i686-clang-%MINGW_TOOLCHAIN_VERSION%-any.pkg.tar.zst"
# set the specific version of doxygen (06-Jun-2018), need to look at this later.
- C:\msys64\usr\bin\bash -lc "pacman -U --noconfirm http://repo.msys2.org/mingw/i686/mingw-w64-i686-doxygen-%DOXYGEN_VERSION%-any.pkg.tar.zst"
- C:\msys64\usr\bin\bash -lc "pacman -U --noconfirm http://repo.msys2.org/mingw/i686/mingw-w64-i686-graphviz-%GRAPHVIZ_VERSION%-any.pkg.tar.zst"
# Download a 32-bit version of windres.exe
- appveyor DownloadFile http://swdownloads.analog.com/cse/build/windres.exe.gz -FileName C:\windres.exe.gz
- C:\msys64\usr\bin\bash -lc "cd /c ; gunzip windres.exe.gz"
- C:\msys64\usr\bin\bash -lc "cmake -G '%GENERATOR%' -DCMAKE_RC_COMPILER=/c/windres.exe -DGIT_EXECUTABLE=C:/Program\ Files/Git/cmd/git.exe -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=/mingw32 -DCMAKE_C_COMPILER:FILEPATH=/mingw32/bin/i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=/mingw32/bin/i686-w64-mingw32-g++.exe -DPKG_CONFIG_EXECUTABLE:FILEPATH=/mingw32/bin/pkg-config.exe -DENABLE_IPV6:BOOL=OFF -DLIBSERIALPORT_LIBRARIES=/c/libs/32/libserialport.dll.a -DLIBSERIALPORT_INCLUDE_DIR=/c/include -DLIBLZMA_LIBRARY=c:/msys64/mingw32/lib/liblzma.dll.a /c/projects/libiio && make -j3"
# MinGW 64 bit
- cd c:\projects\libiio
- echo "Running cmake for MinGW 64 bit... "
- mkdir c:\projects\libiio\build-mingw-win64
- cd c:\projects\libiio\build-mingw-win64
- mkdir c:\projects\libiio\build-mingw-win64\"%configuration%"& cd c:\projects\libiio\build-mingw-win64\"%configuration%"
- C:\msys64\usr\bin\bash -lc "pwd"
- 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-libusb mingw-w64-x86_64-curl mingw-w64-x86_64-cmake mingw-w64-x86_64-libxml2 mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libzip"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy pacman"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Su"
# Newer llvm breaks doxygen, use old version for now
- C:\msys64\usr\bin\bash -lc "pacman -U --noconfirm http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-llvm-%MINGW_TOOLCHAIN_VERSION%-any.pkg.tar.zst http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-clang-%MINGW_TOOLCHAIN_VERSION%-any.pkg.tar.zst"
# set the specific version of doxygen, need to look at this later.
- C:\msys64\usr\bin\bash -lc "pacman -U --noconfirm http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-doxygen-%DOXYGEN_VERSION%-any.pkg.tar.zst"
- C:\msys64\usr\bin\bash -lc "pacman -U --noconfirm http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-graphviz-%GRAPHVIZ_VERSION%-any.pkg.tar.zst"
- C:\msys64\usr\bin\bash -lc "cmake -G '%GENERATOR%' -DCMAKE_RC_COMPILER=/c/msys64/mingw64/bin/windres.exe -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=/mingw64 -DCMAKE_C_COMPILER:FILEPATH=/mingw64/bin/x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=/mingw64/bin/x86_64-w64-mingw32-g++.exe -DPKG_CONFIG_EXECUTABLE:FILEPATH=/mingw64/bin/pkg-config.exe -DENABLE_IPV6:BOOL=OFF -DLIBSERIALPORT_LIBRARIES=/c/libs/64/libserialport.dll.a -DLIBSERIALPORT_INCLUDE_DIR=/c/include /c/projects/libiio && make -j3"
# Move the tests folder
- cd c:\projects\libiio
- mkdir build-mingw-win32\tests\ build-mingw-win32\tests\"%configuration%"& copy build-mingw-win32\Release\tests\*.exe build-mingw-win32\tests\"%configuration%"\
- mkdir build-mingw-win64\tests\ build-mingw-win64\tests\"%configuration%"& copy build-mingw-win64\Release\tests\*.exe build-mingw-win64\tests\"%configuration%"\
- set PATH=%OLD_PATH%
- set GENERATOR=Visual Studio 12
- cd c:\projects\libiio
- set folder-path=c:\projects\libiio\build-win32
#MSVC 32 bit
- set PATH=C:\\Python37;C:\\Python37\\libs;%PATH%
- echo "Running cmake for Visual Studio 32 bit... "
- mkdir build-win32
- cd build-win32
- set MCS_EXECUTABLE_PATH="C:\Windows\Microsoft.NET\Framework\v4.0.30319"
- cmake -G "%GENERATOR%" -DCMAKE_BUILD_TYPE:STRING="%configuration%" -DENABLE_IPV6:BOOL=OFF -DCMAKE_SYSTEM_PREFIX_PATH="C:" -DCSHARP_BINDINGS:BOOL=ON -DPYTHON_BINDINGS:BOOL=ON -DLIBXML2_LIBRARIES="C:\\libs\\32\\libxml2.lib" -DLIBUSB_LIBRARIES="C:\\libs\\32\\libusb-1.0.lib" -DLIBSERIALPORT_LIBRARIES="C:\\libs\\32\\libserialport.dll.a" ..
- cmake --build . --config %configuration%
- cd bindings/python
- python.exe setup.py sdist
- ps: Get-ChildItem dist\libiio-*.tar.gz | Rename-Item -NewName "libiio-py37-win32.tar.gz"
- ps: cp dist\*.tar.gz .
- ps: rm dist\*.tar.gz
- set PATH=C:\\Python36;C:\\Python36\\libs;%PATH%
- python.exe setup.py sdist
- ps: Get-ChildItem dist\libiio-*.tar.gz | Rename-Item -NewName "libiio-py36-win32.tar.gz"
- ps: cp dist\*.tar.gz .
- ps: rm dist\*.tar.gz
#MSVC 64 bit
- set PATH=C:\Python37-x64;C:\\Python37-x64\\libs;%PATH%
- cd c:\projects\libiio
- echo "Running cmake for Visual Studio 64 bit... "
- mkdir build-win64
- cd build-win64
- cmake -G "%GENERATOR% Win64" -DCMAKE_BUILD_TYPE:STRING="%configuration%" -DENABLE_IPV6:BOOL=OFF -DCMAKE_SYSTEM_PREFIX_PATH="C:" -DCSHARP_BINDINGS:BOOL=ON -DPYTHON_BINDINGS:BOOL=ON -DLIBXML2_LIBRARIES="C:\\libs\\64\\libxml2.lib" -DLIBUSB_LIBRARIES="C:\\libs\\64\\libusb-1.0.lib" -DLIBSERIALPORT_LIBRARIES="C:\\libs\\64\\libserialport.dll.a" ..
- cmake --build . --config %configuration%
- cd bindings/python
- python.exe setup.py sdist
- ps: Get-ChildItem dist\libiio-*.tar.gz | Rename-Item -NewName "libiio-py37-amd64.tar.gz"
- ps: cp dist\*.tar.gz .
- ps: rm dist\*.tar.gz
- set PATH=C:\Python36-x64;C:\\Python36-x64\\libs;%PATH%
- python.exe setup.py sdist
- ps: Get-ChildItem dist\libiio-*.tar.gz | Rename-Item -NewName "libiio-py36-amd64.tar.gz"
- ps: cp dist\*.tar.gz .
- ps: rm dist\*.tar.gz
- cd c:\projects\libiio\build-win64
#Create the installer
- ISCC %folder-path%\libiio.iss
- appveyor PushArtifact C:\libiio-setup.exe
# Create ZIP package
# set LIBIIO_VERSION to current project version determined by cmake
- ps: >-
Set-AppveyorBuildVariable -Name LIBIIO_VERSION -Value (get-content .version)
- set ARCHIVE_NAME=libiio-%LIBIIO_VERSION%
- cd c:\projects\libiio
- mkdir c:\%ARCHIVE_NAME% c:\%ARCHIVE_NAME%\include c:\%ARCHIVE_NAME%\MS32 c:\%ARCHIVE_NAME%\MS64 c:\%ARCHIVE_NAME%\MinGW32 c:\%ARCHIVE_NAME%\MinGW64
- copy iio.h c:\%ARCHIVE_NAME%\include
- copy build-win32\Release\libiio.* c:\%ARCHIVE_NAME%\MS32
- copy build-win64\Release\libiio.* c:\%ARCHIVE_NAME%\MS64
- copy build-win32\bindings\csharp\libiio-sharp.dll c:\%ARCHIVE_NAME%\MS32
- copy build-win64\bindings\csharp\libiio-sharp.dll c:\%ARCHIVE_NAME%\MS64
- copy build-win32\bindings\python\*.tar.gz c:\%ARCHIVE_NAME%\MS32
- copy build-win64\bindings\python\*.tar.gz c:\%ARCHIVE_NAME%\MS64
- copy build-mingw-win32\Release\libiio.* c:\%ARCHIVE_NAME%\MinGW32
- copy build-mingw-win64\Release\libiio.* c:\%ARCHIVE_NAME%\MinGW64
- del c:\%ARCHIVE_NAME%\MinGW32\libiio.iss
- del c:\%ARCHIVE_NAME%\MinGW64\libiio.iss
- del c:\%ARCHIVE_NAME%\MinGW32\libiio.pc
- del c:\%ARCHIVE_NAME%\MinGW64\libiio.pc
- copy build-win32\tests\Release\*.exe c:\%ARCHIVE_NAME%\MS32
- copy build-win64\tests\Release\*.exe c:\%ARCHIVE_NAME%\MS64
- copy build-mingw-win32\tests\Release\*.exe c:\%ARCHIVE_NAME%\MinGW32
- copy build-mingw-win64\tests\Release\*.exe c:\%ARCHIVE_NAME%\MinGW64
#Copy dependencies for MSVC
- copy c:\libs\32\libxml2.dll c:\%ARCHIVE_NAME%\MS32
- copy c:\libs\64\libxml2.dll c:\%ARCHIVE_NAME%\MS64
- copy c:\libs\32\libusb-1.0.dll c:\%ARCHIVE_NAME%\MS32
- copy c:\libs\64\libusb-1.0.dll c:\%ARCHIVE_NAME%\MS64
- copy c:\libs\32\libserialport-0.dll c:\%ARCHIVE_NAME%\MS32
- copy c:\libs\64\libserialport-0.dll c:\%ARCHIVE_NAME%\MS64
#Copy dependencies for MinGW
- C:\msys64\usr\bin\bash -lc "cd c:/msys64/mingw32/bin ; cp -r libwinpthread-*.dll libgcc_*.dll libstdc++-*.dll libiconv-*.dll zlib*.dll libxml2-*.dll liblzma-*.dll libzip*.dll libusb-*.dll /c/%ARCHIVE_NAME%/MinGW32"
- C:\msys64\usr\bin\bash -lc "cd c:/msys64/mingw64/bin ; cp -r libwinpthread-*.dll libgcc_*.dll libstdc++-*.dll libiconv-*.dll zlib*.dll libxml2-*.dll liblzma-*.dll libzip*.dll libusb-*.dll /c/%ARCHIVE_NAME%/MinGW64"
- C:\msys64\usr\bin\bash -lc "cd c:/libs/32 ; cp libserialport-*.dll /c/%ARCHIVE_NAME%/MinGW32"
- C:\msys64\usr\bin\bash -lc "cd c:/libs/64 ; cp libserialport-*.dll /c/%ARCHIVE_NAME%/MinGW64"
- copy "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x86\Microsoft.VC120.CRT\msvcr120.dll" c:\%ARCHIVE_NAME%\MS32
- copy "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" c:\%ARCHIVE_NAME%\MS64
- copy c:\projects\libiio\CI\travis\zip.txt c:\%ARCHIVE_NAME%\README.txt
- 7z a "c:\libiio.zip" c:\%ARCHIVE_NAME%
- appveyor PushArtifact c:\libiio.zip