mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-08 17:44:09 +00:00
Use lambda instead of boost::build when genenic lambdas are available in the compiler
This commit is contained in:
parent
a49e4d48f6
commit
fdb0f35116
@ -76,6 +76,14 @@ target_compile_definitions(front-end-cal
|
|||||||
PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(has_generic_lambdas HAS_GENERIC_LAMBDA=1)
|
||||||
|
set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0)
|
||||||
|
target_compile_definitions(front-end-cal
|
||||||
|
PRIVATE
|
||||||
|
"$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
|
||||||
|
"$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
|
||||||
|
)
|
||||||
|
|
||||||
if(ENABLE_CLANG_TIDY)
|
if(ENABLE_CLANG_TIDY)
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
set_target_properties(front-end-cal
|
set_target_properties(front-end-cal
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
|
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
|
||||||
#include "gps_utc_model.h"
|
#include "gps_utc_model.h"
|
||||||
#include <boost/any.hpp> // for bad_any_cast
|
#include <boost/any.hpp> // for bad_any_cast
|
||||||
#include <boost/bind.hpp>
|
|
||||||
#include <boost/exception/exception.hpp>
|
#include <boost/exception/exception.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <gflags/gflags.h>
|
#include <gflags/gflags.h>
|
||||||
@ -70,6 +69,11 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#if HAS_GENERIC_LAMBDA
|
||||||
|
#else
|
||||||
|
#include <boost/bind.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_STD_FILESYSTEM
|
#if HAS_STD_FILESYSTEM
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
@ -142,7 +146,12 @@ void FrontEndCal_msg_rx::msg_handler_events(const pmt::pmt_t& msg)
|
|||||||
FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
||||||
{
|
{
|
||||||
this->message_port_register_in(pmt::mp("events"));
|
this->message_port_register_in(pmt::mp("events"));
|
||||||
this->set_msg_handler(pmt::mp("events"), boost::bind(&FrontEndCal_msg_rx::msg_handler_events, this, _1));
|
this->set_msg_handler(pmt::mp("events"),
|
||||||
|
#if HAS_GENERIC_LAMBDA
|
||||||
|
[this](auto&& PH1) { msg_handler_events(PH1); });
|
||||||
|
#else
|
||||||
|
boost::bind(&FrontEndCal_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user