mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-19 05:33:02 +00:00
Use lambda instead of boost::build when genenic lambdas are available in the compiler
This commit is contained in:
parent
9c9a7b5bc6
commit
a75526d780
@ -542,6 +542,20 @@ if(ENABLE_UNIT_TESTING)
|
|||||||
${CUDA_INCLUDE_DIRS}
|
${CUDA_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
endif()
|
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(run_tests
|
||||||
|
PRIVATE
|
||||||
|
"$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
|
||||||
|
"$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(run_tests
|
||||||
|
PRIVATE
|
||||||
|
-DHAS_GENERIC_LAMBDA=0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_FPGA)
|
if(ENABLE_FPGA)
|
||||||
@ -914,6 +928,21 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA)
|
|||||||
|
|
||||||
add_test(acq_test acq_test)
|
add_test(acq_test acq_test)
|
||||||
|
|
||||||
|
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(acq_test
|
||||||
|
PRIVATE
|
||||||
|
"$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
|
||||||
|
"$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(acq_test
|
||||||
|
PRIVATE
|
||||||
|
-DHAS_GENERIC_LAMBDA=0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_property(TEST acq_test PROPERTY TIMEOUT 30)
|
set_property(TEST acq_test PROPERTY TIMEOUT 30)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -152,7 +152,12 @@ void AcqPerfTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
|||||||
AcqPerfTest_msg_rx::AcqPerfTest_msg_rx(Concurrent_Queue<int>& queue) : gr::block("AcqPerfTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue)
|
AcqPerfTest_msg_rx::AcqPerfTest_msg_rx(Concurrent_Queue<int>& queue) : gr::block("AcqPerfTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue)
|
||||||
{
|
{
|
||||||
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(&AcqPerfTest_msg_rx::msg_handler_events, this, _1));
|
this->set_msg_handler(pmt::mp("events"),
|
||||||
|
#if HAS_GENNERIC_LAMBDA
|
||||||
|
[this](auto&& PH1) { msg_handler_events(PH1); });
|
||||||
|
#else
|
||||||
|
boost::bind(&AcqPerfTest_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,12 @@ void BeidouB1iPcpsAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
|||||||
BeidouB1iPcpsAcquisitionTest_msg_rx::BeidouB1iPcpsAcquisitionTest_msg_rx() : gr::block("BeidouB1iPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
BeidouB1iPcpsAcquisitionTest_msg_rx::BeidouB1iPcpsAcquisitionTest_msg_rx() : gr::block("BeidouB1iPcpsAcquisitionTest_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(&BeidouB1iPcpsAcquisitionTest_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(&BeidouB1iPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,12 @@ void BeidouB3iPcpsAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t msg)
|
|||||||
BeidouB3iPcpsAcquisitionTest_msg_rx::BeidouB3iPcpsAcquisitionTest_msg_rx() : gr::block("BeidouB3iPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
BeidouB3iPcpsAcquisitionTest_msg_rx::BeidouB3iPcpsAcquisitionTest_msg_rx() : gr::block("BeidouB3iPcpsAcquisitionTest_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(&BeidouB3iPcpsAcquisitionTest_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(&BeidouB3iPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,12 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events
|
|||||||
GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue<int>& queue) : gr::block("GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue)
|
GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue<int>& queue) : gr::block("GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue)
|
||||||
{
|
{
|
||||||
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(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_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(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,12 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pm
|
|||||||
GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue<int>& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue)
|
GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue<int>& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue)
|
||||||
{
|
{
|
||||||
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(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_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(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,12 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events(pmt::p
|
|||||||
GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(Concurrent_Queue<int>& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue)
|
GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(Concurrent_Queue<int>& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue)
|
||||||
{
|
{
|
||||||
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(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest_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(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,12 @@ void GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events(const pmt::pmt_t &msg
|
|||||||
GpsL1CaPcpsAcquisitionTest_msg_rx::GpsL1CaPcpsAcquisitionTest_msg_rx() : gr::block("GpsL1CaPcpsAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
GpsL1CaPcpsAcquisitionTest_msg_rx::GpsL1CaPcpsAcquisitionTest_msg_rx() : gr::block("GpsL1CaPcpsAcquisitionTest_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(&GpsL1CaPcpsAcquisitionTest_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(&GpsL1CaPcpsAcquisitionTest_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,21 @@ target_link_libraries(signal_processing_testing_lib
|
|||||||
Glog::glog
|
Glog::glog
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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(signal_processing_testing_lib
|
||||||
|
PRIVATE
|
||||||
|
"$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
|
||||||
|
"$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(signal_processing_testing_lib
|
||||||
|
PRIVATE
|
||||||
|
-DHAS_GENERIC_LAMBDA=0
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_CLANG_TIDY)
|
if(ENABLE_CLANG_TIDY)
|
||||||
if(CLANG_TIDY_EXE)
|
if(CLANG_TIDY_EXE)
|
||||||
set_target_properties(signal_processing_testing_lib
|
set_target_properties(signal_processing_testing_lib
|
||||||
|
@ -20,13 +20,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "acquisition_msg_rx.h"
|
#include "acquisition_msg_rx.h"
|
||||||
#include <boost/bind.hpp>
|
|
||||||
#include <gflags/gflags.h>
|
#include <gflags/gflags.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
|
||||||
Acquisition_msg_rx_sptr Acquisition_msg_rx_make()
|
Acquisition_msg_rx_sptr Acquisition_msg_rx_make()
|
||||||
{
|
{
|
||||||
return Acquisition_msg_rx_sptr(new Acquisition_msg_rx());
|
return Acquisition_msg_rx_sptr(new Acquisition_msg_rx());
|
||||||
@ -52,7 +50,12 @@ void Acquisition_msg_rx::msg_handler_events(const pmt::pmt_t& msg)
|
|||||||
Acquisition_msg_rx::Acquisition_msg_rx() : gr::block("Acquisition_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
Acquisition_msg_rx::Acquisition_msg_rx() : gr::block("Acquisition_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(&Acquisition_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(&Acquisition_msg_rx::msg_handler_events, this, _1));
|
||||||
|
#endif
|
||||||
rx_message = 0;
|
rx_message = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user