Skip to content

Commit

Permalink
azure-pipelines.yml: build mingw with msys2 bash
Browse files Browse the repository at this point in the history
With the new script added we can build libiio via msys2 bash using also
dependencis installed with pacman.

By removing the old dll files that were downloaded from an archive the
paths to the dependencies needed to be modified and now they are copied
from the mingw64 folder.

Signed-off-by: Andreea Andrisan <[email protected]>
  • Loading branch information
AAndrisa committed Oct 23, 2024
1 parent 35176b8 commit 32f815a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 33 deletions.
20 changes: 10 additions & 10 deletions CI/publish_deps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ wget http://swdownloads.analog.com/cse/build/libiio-deps-20220517.zip -OutFile "
dir C:\ghcup\ghc\

if ($COMPILER -eq "MinGW Makefiles") {
cp $src_dir\dependencies\libs\64\libserialport-0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libs\64\libusb-1.0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libs\64\libzstd.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\ghcup\ghc\9.2.8\mingw\bin\libgcc_s_seh-1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\ghcup\ghc\9.6.5\mingw\bin\libiconv-2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\ghcup\ghc\9.6.5\mingw\bin\zlib1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\ghcup\ghc\9.6.5\mingw\bin\liblzma-5.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\ghcup\ghc\9.6.5\mingw\bin\libwinpthread-1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\ghcup\ghc\9.6.5\mingw\bin\libxml2-2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\ghcup\ghc\9.2.8\mingw\bin\libstdc++-6.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\libserialport-0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\libusb-1.0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\libxml2-2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\libzstd.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\libgcc_s_seh-1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\libiconv-2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\zlib1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\liblzma-5.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\libwinpthread-1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\msys64\mingw64\bin\libstdc++-6.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
} else {
cp $src_dir\dependencies\libs\64\libxml2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libs\64\libserialport-0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
Expand Down
38 changes: 15 additions & 23 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ stages:
matrix:
MinGW_W64:
COMPILER: 'MinGW Makefiles'
ARCH: 'x86_64'
USE_CSHARP: 'OFF'
artifactName: 'Windows-MinGW-W64'
pool:
vmImage: 'windows-2022'
Expand All @@ -125,48 +123,42 @@ stages:
inputs:
targetType: inline
script: |
ghcup install ghc 9.2.8
git submodule update --init
if ( !( Test-Path deps ) ) {
mkdir deps
}
cd deps
mkdir libxml
wget https://www.zlatkovic.com/pub/libxml/64bit/libxml2-2.9.3-win32-x86_64.7z -OutFile "libxml.7z"
7z x -y libxml.7z
rm libxml.7z
cd C:\
wget http://swdownloads.analog.com/cse/build/libiio-deps-20220517.zip -OutFile "libiio-win-deps.zip"
7z x -y "C:\libiio-win-deps.zip"
$env:PATH += ";C:\msys64\bin;C:\msys64\mingw64\bin;C:\msys64\usr\bin"
C:\msys64\usr\bin\bash.exe -c "./CI/azure/build_mingw.sh install_pacman_deps"
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: .\CI\build_win.ps1
targetType: inline
script: |
$env:PATH += ";C:\msys64\bin;C:\msys64\mingw64\bin;C:\msys64\usr\bin"
mkdir build-mingw
cd build-mingw
C:\msys64\usr\bin\bash.exe -c "../CI/azure/build_mingw.sh build_libiio"
displayName: 'Build'
- task: CopyFiles@2
displayName: 'Copy .exe files'
inputs:
sourceFolder: '$(Agent.BuildDirectory)/s/build-x64/utils'
sourceFolder: '$(Agent.BuildDirectory)/s/build-mingw/utils'
contents: '*.exe'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: CopyFiles@2
displayName: 'Copy iio.h header'
displayName: 'Copy public headers'
inputs:
sourceFolder: '$(Agent.BuildDirectory)/s/'
contents: 'iio.h'
sourceFolder: '$(Agent.BuildDirectory)/s/include'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: CopyFiles@2
displayName: 'Copy libiio.dll and libiio.dll.a'
displayName: 'Copy libiio.dll, libiio.dll.a and libiio1.dll'
inputs:
sourceFolder: '$(Agent.BuildDirectory)/s/build-x64'
sourceFolder: '$(Agent.BuildDirectory)/s/build-mingw'
contents: |
libiio.dll
libiio.dll.a
libiio1.dll
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: CopyFiles@2
displayName: 'Copy .tar.gz files'
inputs:
sourceFolder: '$(Agent.BuildDirectory)/s/build-x64/bindings/python'
sourceFolder: '$(Agent.BuildDirectory)/s/build-mingw/bindings/python'
contents: '*.gz'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PowerShell@2
Expand Down

0 comments on commit 32f815a

Please sign in to comment.