-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Initial setup, download dependencies Signed-off-by: Adrian Stanea <[email protected]>
- Loading branch information
1 parent
6501ae9
commit d9128a4
Showing
3 changed files
with
236 additions
and
118 deletions.
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,50 @@ | ||
$ErrorActionPreference = "Stop" | ||
$ErrorView = "NormalView" | ||
|
||
$LIBIIO_VERSION = "libiio-v0" | ||
$SRC_DIR = (Get-Location).Path | ||
$COMPILER = $Env:COMPILER | ||
$ARCH = $Env:ARCH | ||
|
||
Write-Output "# libiio $LIBIIO_VERSION for $COMPILER" | ||
|
||
git clone https://github.com/analogdevicesinc/libiio -b $LIBIIO_VERSION libiio | ||
Set-Location -Path "$SRC_DIR\libiio" | ||
git submodule update --init | ||
|
||
Write-Output "# Building libiio dependencies" | ||
|
||
if (-not (Test-Path -Path "$SRC_DIR\deps")) { | ||
New-Item -Path "$SRC_DIR\deps" -ItemType Directory | ||
} | ||
|
||
New-Item -Path "$SRC_DIR\deps\libxml" -ItemType Directory | ||
Set-Location -Path "$SRC_DIR\deps\libxml" | ||
# TODO: check that content is extracted in the right place | ||
# Download and extract libxml | ||
Invoke-WebRequest -Uri "https://www.zlatkovic.com/pub/libxml/64bit/libxml2-2.9.3-win32-x86_64.7z" -OutFile "libxml.7z" | ||
& 7z x -y libxml.7z | ||
Remove-Item -Path "libxml.7z" | ||
ls | ||
|
||
# Download and extract libiio dependencies for Windows | ||
New-Item -Path "$SRC_DIR\deps\libiio-deps" -ItemType Directory | ||
Set-Location -Path "$SRC_DIR\deps\libiio-deps" | ||
Invoke-WebRequest -Uri "http://swdownloads.analog.com/cse/build/libiio-deps-20220517.zip" -OutFile "libiio-win-deps.zip" | ||
& 7z x -y "libiio-win-deps.zip" | ||
Remove-Item -Path "libiio-win-deps.zip" | ||
ls | ||
|
||
# Build libiio -> script 2 from libiio CI (take from github) | ||
Write-Output "### Running cmake for $COMPILER on $ARCH" | ||
Set-Location -Path "$SRC_DIR\libiio" | ||
New-Item -Path "$SRC_DIR\libiio\build-$ARCH" -ItemType Directory | ||
Copy-Item .\libiio.iss.cmakein ".\build-$ARCH" | ||
Set-Location -Path "$SRC_DIR\libiio\build-$ARCH" | ||
|
||
cmake -G "$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 -DCSHARP_BINDINGS:BOOL=$USE_CSHARP -DLIBXML2_LIBRARIES="C:\\libs\\64\\libxml2.lib" -DLIBUSB_LIBRARIES="C:\\libs\\64\\libusb-1.0.lib" -DLIBSERIALPORT_LIBRARIES="C:\\libs\\64\\libserialport.dll.a" -DLIBUSB_INCLUDE_DIR="C:\\include\\libusb-1.0" -DLIBXML2_INCLUDE_DIR="C:\\include\\libxml2" -DLIBZSTD_INCLUDE_DIR="C:\\include" -DLIBZSTD_LIBRARIES="C:\\libs\\64\\libzstd.dll.a" .. | ||
|
||
cmake --build . --config Release | ||
if ( $LASTEXITCODE -ne 0 ) { | ||
throw "[*] cmake build failure" | ||
} |
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,26 @@ | ||
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.2#erroractionpreference | ||
$ErrorActionPreference = "Stop" | ||
$ErrorView = "NormalView" | ||
|
||
$COMPILER=$Env:COMPILER | ||
$USE_CSHARP=$Env:USE_CSHARP | ||
$src_dir=$pwd | ||
|
||
echo "Running cmake for $COMPILER on 64 bit..." | ||
mkdir build-x64 | ||
cp .\libiio.iss.cmakein .\build-x64 | ||
cd build-x64 | ||
|
||
cmake -G "$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 -DCSHARP_BINDINGS:BOOL=$USE_CSHARP -DLIBXML2_LIBRARIES="C:\\libs\\64\\libxml2.lib" -DLIBUSB_LIBRARIES="C:\\libs\\64\\libusb-1.0.lib" -DLIBSERIALPORT_LIBRARIES="C:\\libs\\64\\libserialport.dll.a" -DLIBUSB_INCLUDE_DIR="C:\\include\\libusb-1.0" -DLIBXML2_INCLUDE_DIR="C:\\include\\libxml2" -DLIBZSTD_INCLUDE_DIR="C:\\include" -DLIBZSTD_LIBRARIES="C:\\libs\\64\\libzstd.dll.a" .. | ||
|
||
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