1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-12-18 14:28:05 +00:00

Fix linking against Boost 1.87

CI: add boost in homebrew dependencies
This commit is contained in:
Carles Fernandez
2024-12-20 22:09:52 +01:00
parent 84e85111c5
commit 9158447892
13 changed files with 95 additions and 7 deletions

View File

@@ -132,6 +132,14 @@ if(USE_BOOST_BIND_PLACEHOLDERS)
)
endif()
# Fix for Boost Asio > 1.86. address::from_string was deprecated in Boost 1.71
if(Boost_VERSION_STRING VERSION_LESS 1.71.0)
target_compile_definitions(signal_source_gr_blocks
PRIVATE
-DBOOST_ASIO_USE_FROM_STRING=1
)
endif()
if(USE_GENERIC_LAMBDAS)
set(has_generic_lambdas HAS_GENERIC_LAMBDA=1)
set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0)

View File

@@ -68,9 +68,11 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
{
lookup_[i] = (static_cast<float>(i & 0xff) - 127.4F) * (1.0F / 128.0F);
}
// 2. Set socket options
#if BOOST_ASIO_USE_FROM_STRING
ip::address addr = ip::address::from_string(address, ec);
#else
ip::address addr = ip::make_address(address, ec);
#endif
if (ec)
{
std::cout << address << " is not an IP address\n";
@@ -78,6 +80,8 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address,
return;
}
ip::tcp::endpoint ep(addr, port);
// 2. Set socket options
socket_.open(ep.protocol(), ec); // NOLINT(bugprone-unused-return-value)
if (ec)
{