-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows dependencies build #1197
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3a99e57
CI:azure:build_mingw.sh: add build file for mingw on windows
AAndrisa 12ad5e2
azure-pipelines.yml: build mingw with msys2 bash
AAndrisa 29377b2
CI:azure:windows_build_deps.cmd: builds windows msvc dependencies
AAndrisa b0a5bc3
CI: integrate dependencies build script for msvc
AAndrisa 98feb0d
azure-pipelines.yml: export dependencies sources
AAndrisa e8410d6
artifact_manifest.txt.cmakein: update artifact manifest
AAndrisa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
$@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
:: this script will download and build the necessary dependencies of libiio for windows operating systems | ||
:: if is run from the root of the libiio project all the dependencies will be found in the deps folder of the project | ||
:: in case you already have some dependencies build just comment them in the script and during compilation of libiio specify the path | ||
:: export as environment variables the ARCH, PLATFORM_TOOLSET and COMPILER used for visual studio build | ||
:: ex: set ARCH=x64, PLATFROM_TOOLSET=v143 and COMPILER='Visual Studio 17 2022' for VS2022 | ||
|
||
IF not exist .\deps ( | ||
echo Directory does not exist. Creating it... | ||
mkdir .\deps | ||
) ELSE ( | ||
echo Directory already exists. | ||
cd .\deps | ||
) | ||
choco install -y wget | ||
|
||
:: set the msbuild compiler in order to build from terminal the visual studio projects | ||
SETLOCAL ENABLEDELAYEDEXPANSION | ||
IF "%COMPILER%" == "Visual Studio 16 2019" SET vswhere_params=-version [16,17) -products * | ||
IF "%COMPILER%" == "Visual Studio 17 2022" SET vswhere_params=-version [17,18) -products * | ||
SET vswhere="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" | ||
FOR /F "USEBACKQ TOKENS=*" %%F IN (`%vswhere% !vswhere_params! -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) DO ( | ||
SET msbuild="%%F" | ||
) | ||
:: clone or download releases of the libiio dependencies (libzstd, libusb, libxml2, libserialport) | ||
git clone --branch v1.5.6 https://github.com/facebook/zstd.git | ||
git clone --branch libserialport-0.1.2 https://github.com/sigrokproject/libserialport.git | ||
wget https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z | ||
7z x -y .\libusb-1.0.27.7z -o".\libusb" | ||
rm .\libusb-1.0.27.7z | ||
wget https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz | ||
cmake -E tar xf .\libxml2-2.9.14.tar.xz | ||
rm .\libxml2-2.9.14.tar.xz | ||
|
||
:: create archive with the dependencies for msvc build | ||
7z a -tzip ..\Windows-msvc-deps.zip .\* | ||
|
||
:: build libzstd and libserialport with MSBuild | ||
%msbuild% .\zstd\build\VS2010\zstd.sln /p:Platform=%ARCH% /p:Configuration=Release /p:PlatformToolset=%PLATFORM_TOOLSET% | ||
%msbuild% .\libserialport\libserialport.vcxproj /p:Platform=%ARCH% /p:Configuration=Release /p:PlatformToolset=%PLATFORM_TOOLSET% | ||
:: build libxml with cmake | ||
cmake -DCMAKE_INSTALL_PREFIX=libxml2-install -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ZLIB=OFF -S .\libxml2-2.9.14\ -B libxml2-build | ||
cmake --build libxml2-build --config Release --target install |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.2#erroractionpreference | ||
$ErrorActionPreference = "Stop" | ||
$ErrorView = "NormalView" | ||
|
||
echo "Running cmake for $Env:COMPILER on 64 bit..." | ||
mkdir build-msvc | ||
cp .\libiio.iss.cmakein .\build-msvc | ||
cd build-msvc | ||
if ( "$Env:COMPILER" -eq "Visual Studio 17 2022" ){ | ||
$VS_version="VS2022" | ||
}elseif ( "$Env:COMPILER" -eq "Visual Studio 16 2019" ) { | ||
$VS_version="VS2019" | ||
} | ||
cmake -G "$Env:COMPILER" -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=ON ` | ||
-DLIBXML2_LIBRARIES="$Env:BUILD_SOURCESDIRECTORY\deps\libxml2-install\lib\libxml2.lib" -DLIBXML2_INCLUDE_DIR="$Env:BUILD_SOURCESDIRECTORY\deps\libxml2-install\include\libxml2" ` | ||
-DLIBUSB_LIBRARIES="$Env:BUILD_SOURCESDIRECTORY\deps\libusb\$VS_version\MS64\dll\libusb-1.0.lib" -DLIBUSB_INCLUDE_DIR="$Env:BUILD_SOURCESDIRECTORY\deps\libusb\include" ` | ||
-DLIBSERIALPORT_LIBRARIES="$Env:BUILD_SOURCESDIRECTORY\deps\libserialport\x64\Release\libserialport.lib" -DLIBSERIALPORT_INCLUDE_DIR="$Env:BUILD_SOURCESDIRECTORY\deps\libserialport" ` | ||
-DLIBZSTD_LIBRARIES="$Env:BUILD_SOURCESDIRECTORY\deps\zstd\build\VS2010\bin\x64_Release\libzstd.lib" -DLIBZSTD_INCLUDE_DIR="$Env:BUILD_SOURCESDIRECTORY\deps\zstd\lib" .. | ||
|
||
cmake --build . --config Release | ||
|
||
if ( $LASTEXITCODE -ne 0 ) { | ||
throw "[*] cmake build failure" | ||
} | ||
cp .\libiio.iss $env:BUILD_ARTIFACTSTAGINGDIRECTORY | ||
|
||
cd bindings/python | ||
python.exe setup.py sdist | ||
Get-ChildItem dist\pylibiio-*.tar.gz | Rename-Item -NewName "libiio-py39-amd64.tar.gz" | ||
mv .\dist\*.gz . | ||
rm .\dist\*.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,60 +48,84 @@ Ubuntu-x390x/libiio-@[email protected]@[email protected] | |
Debian12-arm/libiio-@[email protected]@[email protected] | ||
Debian12-arm/libiio-@[email protected]@[email protected] | ||
|
||
Windows-VS-2019-x64/iio.h | ||
Windows-VS-2019-x64/Windows-msvc-deps.zip | ||
Windows-VS-2019-x64/iio/iio.h | ||
Windows-VS-2019-x64/iio/iio-backend.h | ||
Windows-VS-2019-x64/iio/iiod-client.h | ||
Windows-VS-2019-x64/iio/iio-debug.h | ||
Windows-VS-2019-x64/iio/iio-lock.h | ||
Windows-VS-2019-x64/iio_attr.exe | ||
Windows-VS-2019-x64/iio_genxml.exe | ||
Windows-VS-2019-x64/iio_attr.exe | ||
Windows-VS-2019-x64/iio_event.exe | ||
Windows-VS-2019-x64/iio_info.exe | ||
Windows-VS-2019-x64/iio_readdev.exe | ||
Windows-VS-2019-x64/iio_rwdev.exe | ||
Windows-VS-2019-x64/iio_reg.exe | ||
Windows-VS-2019-x64/iio_writedev.exe | ||
Windows-VS-2019-x64/iiod_responder.lib | ||
Windows-VS-2019-x64/libiio-py39-amd64.tar.gz | ||
Windows-VS-2019-x64/iio.dll | ||
Windows-VS-2019-x64/libiio-sharp.dll | ||
Windows-VS-2019-x64/libiio.dll | ||
Windows-VS-2019-x64/libiio.exp | ||
Windows-VS-2019-x64/libiio1.dll | ||
Windows-VS-2019-x64/libiio1.exp | ||
Windows-VS-2019-x64/libiio.iss | ||
Windows-VS-2019-x64/libiio.lib | ||
Windows-VS-2019-x64/libserialport-0.dll | ||
Windows-VS-2019-x64/libiio1.lib | ||
Windows-VS-2019-x64/libiio1.pdb | ||
Windows-VS-2019-x64/libserialport.dll | ||
Windows-VS-2019-x64/libusb-1.0.dll | ||
Windows-VS-2019-x64/libxml2.dll | ||
Windows-VS-2019-x64/libzstd.dll | ||
Windows-VS-2019-x64/msvcp140.dll | ||
Windows-VS-2019-x64/vcruntime140.dll | ||
|
||
Windows-VS-2022-x64/iio.h | ||
Windows-VS-2022-x64/Windows-msvc-deps.zip | ||
Windows-VS-2022-x64/iio/iio.h | ||
Windows-VS-2022-x64/iio/iio-backend.h | ||
Windows-VS-2022-x64/iio/iiod-client.h | ||
Windows-VS-2022-x64/iio/iio-debug.h | ||
Windows-VS-2022-x64/iio/iio-lock.h | ||
Windows-VS-2022-x64/iio_attr.exe | ||
Windows-VS-2022-x64/iio_attr.exe | ||
Windows-VS-2022-x64/iio_genxml.exe | ||
Windows-VS-2022-x64/iio_event.exe | ||
Windows-VS-2022-x64/iio_info.exe | ||
Windows-VS-2022-x64/iio_readdev.exe | ||
Windows-VS-2022-x64/iio_rwdev.exe | ||
Windows-VS-2022-x64/iio_reg.exe | ||
Windows-VS-2022-x64/iio_writedev.exe | ||
Windows-VS-2022-x64/iiod_responder.lib | ||
Windows-VS-2022-x64/libiio-py39-amd64.tar.gz | ||
Windows-VS-2022-x64/iio.dll | ||
Windows-VS-2022-x64/libiio-sharp.dll | ||
Windows-VS-2022-x64/libiio.dll | ||
Windows-VS-2022-x64/libiio.exp | ||
Windows-VS-2022-x64/libiio1.dll | ||
Windows-VS-2022-x64/libiio1.exp | ||
Windows-VS-2022-x64/libiio.iss | ||
Windows-VS-2022-x64/libiio.lib | ||
Windows-VS-2022-x64/libserialport-0.dll | ||
Windows-VS-2022-x64/libiio1.lib | ||
Windows-VS-2022-x64/libiio1.pdb | ||
Windows-VS-2022-x64/libserialport.dll | ||
Windows-VS-2022-x64/libusb-1.0.dll | ||
Windows-VS-2022-x64/libxml2.dll | ||
Windows-VS-2022-x64/libzstd.dll | ||
Windows-VS-2022-x64/msvcp140.dll | ||
Windows-VS-2022-x64/vcruntime140.dll | ||
|
||
Windows-MinGW--W64/iio.h | ||
Windows-MinGW-W64/iio/iio.h | ||
Windows-MinGW-W64/iio/iio-backend.h | ||
Windows-MinGW-W64/iio/iiod-client.h | ||
Windows-MinGW-W64/iio/iio-debug.h | ||
Windows-MinGW-W64/iio/iio-lock.h | ||
Windows-MinGW-W64/iio_attr.exe | ||
Windows-MinGW-W64/iio_event.exe | ||
Windows-MinGW-W64/iio_genxml.exe | ||
Windows-MinGW-W64/iio_info.exe | ||
Windows-MinGW-W64/iio_readdev.exe | ||
Windows-MinGW-W64/iio_rwdev.exe | ||
Windows-MinGW-W64/iio_reg.exe | ||
Windows-MinGW-W64/iio_writedev.exe | ||
Windows-MinGW-W64/libgcc_s_seh-1.dll | ||
Windows-MinGW-W64/libiconv-2.dll | ||
Windows-MinGW-W64/libiio.dll | ||
Windows-MinGW-W64/libiio.dll.a | ||
Windows-MinGW-W64/libiio1.dll | ||
Windows-MinGW-W64/liblzma-5.dll | ||
Windows-MinGW-W64/libserialport-0.dll | ||
Windows-MinGW-W64/libstdc++-6.dll | ||
Windows-MinGW-W64/libusb-1.0.dll | ||
Windows-MinGW-W64/libwinpthread-1.dll | ||
Windows-MinGW-W64/libxml2-2.dll | ||
Windows-MinGW-W64/libzstd.dll | ||
Windows-MinGW-W64/zlib1.dll | ||
Windows-MinGW-W64/libiio-py39-amd64.tar.gz |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: PLATFROM_TOOLSET