Skip to content

Commit 608f42c

Browse files
committed
Add CI checks for SoapySDR versions
1 parent 1aac82a commit 608f42c

File tree

3 files changed

+45
-29
lines changed

3 files changed

+45
-29
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,47 @@
1-
name: Build check
1+
name: CI
22
on:
33
push:
44
pull_request:
55
workflow_dispatch:
66

77
jobs:
8-
macos_build_job:
8+
windows-ci:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
os: [macos-14, macos-15]
13-
runs-on: ${{ matrix.os }}
14-
name: Build on ${{ matrix.os }}
15-
steps:
16-
- uses: actions/checkout@v4
17-
- name: Setup tools
18-
run: brew install soapysdr
19-
- name: Build
20-
run: |
21-
cmake -B build
22-
cmake --build build
12+
build_type: [Release]
13+
config:
14+
- cmake_config: -G "Visual Studio 17 2022" -A "x64"
15+
arch: x64
16+
os: windows-2025
2317

24-
linux_build_job:
25-
strategy:
26-
fail-fast: false
27-
matrix:
28-
os: [ubuntu-22.04, ubuntu-24.04]
29-
runs-on: ${{ matrix.os }}
30-
name: Build on ${{ matrix.os }}
18+
runs-on: ${{ matrix.config.os }}
19+
name: Build on ${{ matrix.config.os }}
20+
env:
21+
INSTALL_PREFIX: 'C:\Program Files\SoapySDR'
3122
steps:
3223
- uses: actions/checkout@v4
33-
- name: Setup tools
24+
- uses: ilammy/msvc-dev-cmd@v1
25+
with:
26+
arch: ${{matrix.config.arch}}
27+
- name: Install SoapySDR
3428
run: |
35-
sudo apt-get update -q -y
36-
sudo apt-get install -y --no-install-recommends cmake ninja-build
37-
sudo apt-get install -q -y libsoapysdr-dev
29+
cd ${{runner.workspace}}
30+
# Build SoapySDR that supports OS X GCC modules
31+
git clone https://github.com/pothosware/SoapySDR
32+
cd SoapySDR
33+
git checkout f8d57652d12f9d212f373a81e493eba1a0b058c5
34+
cmake ${{matrix.config.cmake_config}} -DENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX="$Env:INSTALL_PREFIX" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -B build
35+
cmake --build build --config ${{matrix.build_type}}
36+
cmake --install build --config ${{matrix.build_type}}
3837
- name: Build
3938
run: |
40-
cmake -GNinja -B build
41-
cmake --build build
39+
$Env:INCLUDE += ";$Env:INSTALL_PREFIX\include"
40+
$Env:LIB += ";$Env:INSTALL_PREFIX\lib"
41+
cmake ${{matrix.config.cmake_config}} -DCMAKE_INSTALL_PREFIX="$Env:INSTALL_PREFIX" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -B build
42+
cmake --build build --config ${{matrix.build_type}}
43+
cmake --install build --config ${{matrix.build_type}}
44+
- name: Test module registration
45+
run: |
46+
$Env:PATH += ";$Env:INSTALL_PREFIX\bin"
47+
SoapySDRUtil --check=rtltcp

Settings.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#include <algorithm>
2828
#include <cstring>
2929

30+
#ifdef _MSC_VER
31+
#include <BaseTsd.h>
32+
typedef SSIZE_T ssize_t;
33+
#endif
34+
3035
#define DEFAULT_PORT "1234"
3136

3237
SoapyRTLTCP::SoapyRTLTCP(const SoapySDR::Kwargs &args):
@@ -116,13 +121,13 @@ int SoapyRTLTCP::recvHeader()
116121
int ret = select(serverSocket + 1, &readfds, NULL, NULL, &tv);
117122
if (ret)
118123
{
119-
ssize_t received = recv(serverSocket, (char *)&cmd + (sizeof(cmd) - left), left, 0);
124+
ssize_t received = recv(serverSocket, &cmd[0] + (sizeof(cmd) - left), left, 0);
120125
if (received < 0)
121126
{
122127
SoapySDR_logf(SOAPY_SDR_DEBUG, "server recv error");
123128
break;
124129
}
125-
left -= received;
130+
left -= (int)received;
126131
}
127132
}
128133

Streaming.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
#include <climits> //SHRT_MAX
3131
#include <cstring> // memcpy
3232

33+
#ifdef _MSC_VER
34+
#include <BaseTsd.h>
35+
typedef SSIZE_T ssize_t;
36+
#endif
37+
3338
std::vector<std::string> SoapyRTLTCP::getStreamFormats(const int /*direction*/, const size_t /*channel*/) const
3439
{
3540
std::vector<std::string> formats;
@@ -99,7 +104,7 @@ void SoapyRTLTCP::net_recv_operation(void)
99104
}
100105

101106
// Block on recv
102-
ssize_t received = recv(serverSocket, _buf + tail, chunk_size, 0);
107+
ssize_t received = recv(serverSocket, (char *)_buf + tail, chunk_size, 0);
103108
if (received <= 0)
104109
{
105110
SoapySDR_logf(SOAPY_SDR_DEBUG, "RTL-TCP server recv end");

0 commit comments

Comments
 (0)