mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-31 11:19:18 +00:00
Use lambdas if possible.
Fine tuning in CMake scripts
This commit is contained in:
parent
8cc799235b
commit
3beb1e98af
@ -62,8 +62,9 @@ endif()
|
|||||||
|
|
||||||
target_link_libraries(core_libs
|
target_link_libraries(core_libs
|
||||||
PUBLIC
|
PUBLIC
|
||||||
Boost::headers
|
Gnuradio::blocks
|
||||||
Gnuradio::runtime
|
Gnuradio::runtime
|
||||||
|
Gnuradio::pmt
|
||||||
core_libs_supl
|
core_libs_supl
|
||||||
core_system_parameters
|
core_system_parameters
|
||||||
pvt_libs
|
pvt_libs
|
||||||
@ -74,6 +75,12 @@ target_link_libraries(core_libs
|
|||||||
Pugixml::pugixml
|
Pugixml::pugixml
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(USE_GENERIC_LAMBDAS AND NOT GNURADIO_USES_STD_POINTERS)
|
||||||
|
target_link_libraries(core_libs PUBLIC Boost::headers)
|
||||||
|
else()
|
||||||
|
target_link_libraries(core_libs PRIVATE Boost::headers)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(GNURADIO_USES_STD_POINTERS)
|
if(GNURADIO_USES_STD_POINTERS)
|
||||||
target_compile_definitions(core_libs
|
target_compile_definitions(core_libs
|
||||||
PUBLIC -DGNURADIO_USES_STD_POINTERS=1
|
PUBLIC -DGNURADIO_USES_STD_POINTERS=1
|
||||||
|
@ -136,7 +136,6 @@ endif()
|
|||||||
target_link_libraries(core_receiver
|
target_link_libraries(core_receiver
|
||||||
PUBLIC
|
PUBLIC
|
||||||
core_libs
|
core_libs
|
||||||
Gnuradio::runtime
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
core_monitor
|
core_monitor
|
||||||
signal_source_adapters
|
signal_source_adapters
|
||||||
@ -162,6 +161,21 @@ if(ENABLE_ARMA_NO_DEBUG)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(USE_GENERIC_LAMBDAS)
|
||||||
|
set(has_generic_lambdas HAS_GENERIC_LAMBDA=1)
|
||||||
|
set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0)
|
||||||
|
target_compile_definitions(core_receiver
|
||||||
|
PRIVATE
|
||||||
|
"$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
|
||||||
|
"$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(core_receiver
|
||||||
|
PRIVATE
|
||||||
|
-DHAS_GENERIC_LAMBDA=0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Fix for Boost Asio < 1.70
|
# Fix for Boost Asio < 1.70
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
|
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
|
||||||
|
@ -48,13 +48,23 @@ TcpCmdInterface::TcpCmdInterface()
|
|||||||
|
|
||||||
void TcpCmdInterface::register_functions()
|
void TcpCmdInterface::register_functions()
|
||||||
{
|
{
|
||||||
functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind)
|
#if HAS_GENERIC_LAMBDA
|
||||||
functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind)
|
functions["status"] = [&](auto &s) { return TcpCmdInterface::status(s); };
|
||||||
functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind)
|
functions["standby"] = [&](auto &s) { return TcpCmdInterface::standby(s); };
|
||||||
functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind)
|
functions["reset"] = [&](auto &s) { return TcpCmdInterface::reset(s); };
|
||||||
functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind)
|
functions["hotstart"] = [&](auto &s) { return TcpCmdInterface::hotstart(s); };
|
||||||
functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind)
|
functions["warmstart"] = [&](auto &s) { return TcpCmdInterface::warmstart(s); };
|
||||||
functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1); // NOLINT(modernize-avoid-bind)
|
functions["coldstart"] = [&](auto &s) { return TcpCmdInterface::coldstart(s); };
|
||||||
|
functions["set_ch_satellite"] = [&](auto &s) { return TcpCmdInterface::set_ch_satellite(s); };
|
||||||
|
#else
|
||||||
|
functions["status"] = std::bind(&TcpCmdInterface::status, this, std::placeholders::_1);
|
||||||
|
functions["standby"] = std::bind(&TcpCmdInterface::standby, this, std::placeholders::_1);
|
||||||
|
functions["reset"] = std::bind(&TcpCmdInterface::reset, this, std::placeholders::_1);
|
||||||
|
functions["hotstart"] = std::bind(&TcpCmdInterface::hotstart, this, std::placeholders::_1);
|
||||||
|
functions["warmstart"] = std::bind(&TcpCmdInterface::warmstart, this, std::placeholders::_1);
|
||||||
|
functions["coldstart"] = std::bind(&TcpCmdInterface::coldstart, this, std::placeholders::_1);
|
||||||
|
functions["set_ch_satellite"] = std::bind(&TcpCmdInterface::set_ch_satellite, this, std::placeholders::_1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -64,7 +74,7 @@ void TcpCmdInterface::set_pvt(std::shared_ptr<PvtInterface> PVT_sptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
time_t TcpCmdInterface::get_utc_time()
|
time_t TcpCmdInterface::get_utc_time() const
|
||||||
{
|
{
|
||||||
return receiver_utc_time_;
|
return receiver_utc_time_;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief gets the UTC time parsed from the last TC command issued
|
* \brief gets the UTC time parsed from the last TC command issued
|
||||||
*/
|
*/
|
||||||
time_t get_utc_time();
|
time_t get_utc_time() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief gets the Latitude, Longitude and Altitude vector from the last TC command issued
|
* \brief gets the Latitude, Longitude and Altitude vector from the last TC command issued
|
||||||
|
Loading…
Reference in New Issue
Block a user