forked from analogdevicesinc/libiio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
143 lines (127 loc) · 9.18 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
version: 2015.1.{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
- 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"
- 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"
# 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-5.0.0-3-any.pkg.tar.xz http://repo.msys2.org/mingw/i686/mingw-w64-i686-clang-5.0.0-3-any.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-i686-gcc mingw-w64-i686-libusb mingw-w64-i686-cmake mingw-w64-i686-libxml2 mingw-w64-i686-pkg-config mingw-w64-i686-libzip mingw-w64-i686-doxygen"
# 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 -DCSHARP_BINDINGS:BOOL=OFF -DPKG_CONFIG_EXECUTABLE:FILEPATH=/mingw32/bin/pkg-config.exe -DENABLE_IPV6:BOOL=OFF -DPYTHON_BINDINGS:BOOL=OFF -DLIBSERIALPORT_LIBRARIES=/c/libs/32/libserialport.dll.a -DLIBSERIALPORT_INCLUDE_DIR=/c/include /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"
# 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-5.0.0-3-any.pkg.tar.xz http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-clang-5.0.0-3-any.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-x86_64-gcc mingw-w64-x86_64-libusb mingw-w64-x86_64-cmake mingw-w64-x86_64-libxml2 mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libzip mingw-w64-x86_64-doxygen"
- C:\msys64\usr\bin\bash -lc "cmake -G '%GENERATOR%' -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 -DCSHARP_BINDINGS:BOOL=OFF -DPKG_CONFIG_EXECUTABLE:FILEPATH=/mingw64/bin/pkg-config.exe -DENABLE_IPV6:BOOL=OFF -DPYTHON_BINDINGS: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
- 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:" -DPYTHON_BINDINGS:BOOL=OFF -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%
#MSVC 64 bit
- 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:" -DPYTHON_BINDINGS:BOOL=OFF -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%
#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-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
- xcopy /S bindings\matlab c:\%ARCHIVE_NAME%\MS32\matlab\
- xcopy /S bindings\matlab c:\%ARCHIVE_NAME%\MS64\matlab\
- xcopy /S bindings\matlab c:\%ARCHIVE_NAME%\MinGW32\matlab\
- xcopy /S bindings\matlab c:\%ARCHIVE_NAME%\MinGW64\matlab\
- del c:\%ARCHIVE_NAME%\MS32\matlab\CMakeLists.txt
- del c:\%ARCHIVE_NAME%\MS64\matlab\CMakeLists.txt
- del c:\%ARCHIVE_NAME%\MinGW32\matlab\CMakeLists.txt
- del c:\%ARCHIVE_NAME%\MinGW64\matlab\CMakeLists.txt
- 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