-
Notifications
You must be signed in to change notification settings - Fork 313
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
base: main
Are you sure you want to change the base?
Changes from all commits
d365734
b27ec7f
d228cbc
7af64cf
6d27d92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
" | ||
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 | ||
$@ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
:: 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 the zstd repo and build it with the desierd configuration | ||
git clone --branch v1.5.6 https://github.com/facebook/zstd.git | ||
%msbuild% .\zstd\build\VS2010\zstd.sln /p:Platform=%ARCH% /p:Configuration=Release /p:PlatformToolset=%PLATFORM_TOOLSET% | ||
|
||
:: download libusb release | ||
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" | ||
|
||
:: download and build libxml2 library with cmake | ||
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 | ||
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 | ||
|
||
:: clone and build libserialport project | ||
git clone https://github.com/sigrokproject/libserialport.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for other repos - you are getting specific versions. for libserialport - you are grabbing tip of master - is that what you want to do? (I'm not sure there is a better idea, since the newest release is so old)... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another idea would be to specifically git checkout a commit from the master branch, in case other commits will be added in which case that might brake things for us. (if this is not ok, I will leave it as it is) |
||
%msbuild% .\libserialport\libserialport.vcxproj /p:Platform=%ARCH% /p:Configuration=Release /p:PlatformToolset=%PLATFORM_TOOLSET% |
This file was deleted.
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,60 +48,82 @@ 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/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/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 |
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.
should be desired? (spelling)