From d3657346ada1d9a3d1d75bdd2b4f09a68af252c8 Mon Sep 17 00:00:00 2001 From: Andreea Andrisan Date: Thu, 12 Sep 2024 11:47:57 +0300 Subject: [PATCH] CI:azure:build_mingw.sh: add build file for mingw on windows 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 --- CI/azure/build_mingw.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 CI/azure/build_mingw.sh diff --git a/CI/azure/build_mingw.sh b/CI/azure/build_mingw.sh new file mode 100644 index 000000000..55bea61d5 --- /dev/null +++ b/CI/azure/build_mingw.sh @@ -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 + " + pacman -S --noconfirm --needed $WINDEPS +} + +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 +$@