mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-12 05:13:04 +00:00
Use lambda instead of boost::build when genenic lambdas are available in the compiler
This commit is contained in:
@@ -49,6 +49,21 @@ if(GNURADIO_USES_STD_POINTERS)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.1)
|
||||
set(has_generic_lambdas HAS_GENERIC_LAMBDA=1)
|
||||
set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0)
|
||||
target_compile_definitions(pvt_gr_blocks
|
||||
PRIVATE
|
||||
"$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
|
||||
"$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(pvt_gr_blocks
|
||||
PRIVATE
|
||||
-DHAS_GENERIC_LAMBDA=0
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
if(CLANG_TIDY_EXE)
|
||||
set_target_properties(pvt_gr_blocks
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
#include <boost/any.hpp> // for any_cast, any
|
||||
#include <boost/archive/xml_iarchive.hpp> // for xml_iarchive
|
||||
#include <boost/archive/xml_oarchive.hpp> // for xml_oarchive
|
||||
#include <boost/bind/bind.hpp> // for bind_t, bind
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/serialization/map.hpp>
|
||||
@@ -75,6 +74,11 @@
|
||||
#include <sys/ipc.h> // for IPC_CREAT
|
||||
#include <sys/msg.h> // for msgctl
|
||||
|
||||
#if HAS_GENERIC_LAMBDA
|
||||
#else
|
||||
#include <boost/bind.hpp>
|
||||
#endif
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
@@ -186,8 +190,12 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
|
||||
|
||||
// GPS Ephemeris data message port in
|
||||
this->message_port_register_in(pmt::mp("telemetry"));
|
||||
this->set_msg_handler(pmt::mp("telemetry"), boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, _1));
|
||||
|
||||
this->set_msg_handler(pmt::mp("telemetry"),
|
||||
#if HAS_GENERIC_LAMBDA
|
||||
[this](auto&& PH1) { msg_handler_telemetry(PH1); });
|
||||
#else
|
||||
boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, _1));
|
||||
#endif
|
||||
// initialize kml_printer
|
||||
std::string kml_dump_filename;
|
||||
kml_dump_filename = d_dump_filename;
|
||||
|
||||
Reference in New Issue
Block a user