Skip to content
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

Fix Windows Builds #1183

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CI/build_win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ 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 -DCPP_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" ..
if ($COMPILER -eq "MinGW Makefiles") {
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 -DCPP_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" ..
} else {
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 -DCPP_BINDINGS=ON -DCSHARP_BINDINGS:BOOL=$USE_CSHARP -DLIBXML2_LIBRARIES="C:\\libiio-deps-240627\\msvc\\libs\\64\\libxml2.lib" -DLIBUSB_LIBRARIES="C:\\libiio-deps-240627\\msvc\\libs\\64\\libusb-1.0.lib" -DLIBSERIALPORT_LIBRARIES="C:\\libiio-deps-240627\\msvc\\libs\\64\\libserialport.lib" -DLIBUSB_INCLUDE_DIR="C:\\libiio-deps-240627\\msvc\\include\\libusb-1.0" -DLIBXML2_INCLUDE_DIR="C:\\libiio-deps-240627\\msvc\\include\\libxml2" -DLIBSERIALPORT_INCLUDE_DIR="C:\\libiio-deps-240627\\msvc\\include" -DLIBZSTD_INCLUDE_DIR="C:\\libiio-deps-240627\\msvc\\include" -DLIBZSTD_LIBRARIES="C:\\libiio-deps-240627\\msvc\\libs\\64\\libzstd.lib" ..
}

cmake --build . --config Release
if ( $LASTEXITCODE -ne 0 ) {
Expand Down
11 changes: 7 additions & 4 deletions CI/publish_deps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ cd $src_dir
mkdir dependencies
cd dependencies
wget http://swdownloads.analog.com/cse/build/libiio-deps-20220517.zip -OutFile "libiio-win-deps.zip"
wget https://swdownloads.analog.com/cse/build/libiio-deps-20240627.zip -OutFile "libiio-msvc-deps.zip"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would help (in the future) to rename libiio-deps-20200627 to a name that doesn't change over time. For example: libiio-deps-msvc. If at some point in time, there will be a new libiio-deps-yyyymmdd ,then there will be only one place to update the name. Now there are extra 4 places besides this one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i used the yyyy-mm-dd format, to match the naming used in the other archive.
as a side note, the old archive with mingw compiled deps should also be updated to contain all required files. would it make sense to update the names of both archives to leave out the yyyy-mm-dd suffix after fixing the mingw archive as well ?


7z x -y "libiio-win-deps.zip"
7z x -y "libiio-msvc-deps.zip"

# Version numbers inside this directory change all the time; print what's
# currently in the folder to make it easier to debug CI breakages on MinGW.
Expand All @@ -27,10 +30,10 @@ if ($COMPILER -eq "MinGW Makefiles") {
cp C:\ghcup\ghc\9.6.5\mingw\bin\libxml2-2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp C:\ghcup\ghc\9.2.8\mingw\bin\libstdc++-6.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
} else {
cp $src_dir\dependencies\libs\64\libxml2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libs\64\libserialport-0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libs\64\libusb-1.0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libs\64\libzstd.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libiio-deps-240627\msvc\libs\64\libxml2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libiio-deps-240627\msvc\libs\64\libserialport.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libiio-deps-240627\msvc\libs\64\libusb-1.0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY
cp $src_dir\dependencies\libiio-deps-240627\msvc\libs\64\libzstd.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY

if ($COMPILER -eq "Visual Studio 16 2019") {
cd 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT'
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ stages:
7z x -y libxml.7z
rm libxml.7z
cd C:\
wget http://swdownloads.analog.com/cse/build/libiio-deps-20220517.zip -OutFile "libiio-win-deps.zip"
7z x -y "C:\libiio-win-deps.zip"
wget https://swdownloads.analog.com/cse/build/libiio-deps-20240627.zip -OutFile "libiio-win-msvc-deps.zip"
7z x -y "C:\libiio-win-msvc-deps.zip"
- task: PowerShell@2
inputs:
targetType: 'filePath'
Expand Down
2 changes: 1 addition & 1 deletion libiio.iss.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Source: "D:\a\1\a\Windows-VS-2019-x64\libiio1.lib"; DestDir: "{commonpf32}\Micro
Source: "D:\a\1\a\Windows-VS-2019-x64\iio\*.h"; DestDir: "{commonpf32}\Microsoft Visual Studio 12.0\VC\include\iio"
Source: "D:\a\1\a\Windows-VS-2019-x64\libxml2.dll"; DestDir: "{sys}"; Check: Is64BitInstallMode; Flags: onlyifdoesntexist
Source: "D:\a\1\a\Windows-VS-2019-x64\libusb-1.0.dll"; DestDir: "{sys}"; Check: Is64BitInstallMode; Flags: onlyifdoesntexist
Source: "D:\a\1\a\Windows-VS-2019-x64\libserialport-0.dll"; DestDir: "{sys}"; Check: Is64BitInstallMode; Flags: onlyifdoesntexist
Source: "D:\a\1\a\Windows-VS-2019-x64\libserialport.dll"; DestDir: "{sys}"; Check: Is64BitInstallMode; Flags: onlyifdoesntexist
Source: "D:\a\1\a\Windows-VS-2019-x64\libzstd.dll"; DestDir: "{sys}"; Check: Is64BitInstallMode; Flags: onlyifdoesntexist
Source: "D:\a\1\a\Windows-VS-2019-x64\libiio-sharp.dll"; DestDir: "{commoncf}\libiio"; Flags: replacesameversion
Source: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\msvcp140.dll"; DestDir: "{sys}"; Check: Is64BitInstallMode; Flags: onlyifdoesntexist
Expand Down
Loading