Skip to content

Commit

Permalink
CI:azure:build_mingw.sh: add build file for mingw on windows
Browse files Browse the repository at this point in the history
New flow for mingw builds on windows operating system is implemented by
installing the nedeed dependencies and build libiio with the bash from
msys2 that supports also mingw64.

The dependencies will be installed with pacman.

Signed-off-by: Andreea Andrisan <[email protected]>
  • Loading branch information
AAndrisa committed Oct 23, 2024
1 parent 422a72f commit 35176b8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions CI/azure/build_mingw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/bash.exe
set -xe

init_env() {
export ARCH=x86_64
export MINGW_VERSION=mingw64
export CC=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-gcc.exe
export CXX=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-g++.exe
export CMAKE="/$MINGW_VERSION/bin/cmake"

}

install_pacman_deps() {
WINDEPS="mingw-w64-x86_64-libserialport \
mingw-w64-x86_64-libusb \
mingw-w64-x86_64-zstd \
mingw-w64-x86_64-libxml2 \
mingw-w64-x86_64-python3 \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-gcc \
cmake
"
echo "$WINDEPS" | xargs pacman -S --noconfirm --needed
}

build_libiio() {
$CMAKE -G "MinGW Makefiles" -DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '\python.exe')") \
-DCMAKE_SYSTEM_PREFIX_PATH="C:" -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON \
-DENABLE_IPV6=ON -DWITH_USB_BACKEND=ON -DWITH_SERIAL_BACKEND=ON -DPYTHON_BINDINGS=ON -DCPP_BINDINGS=ON \
-DCSHARP_BINDINGS:BOOL=OFF ..
$CMAKE --build . --config Release
}

init_env
$@

0 comments on commit 35176b8

Please sign in to comment.