From 25da76d1a28397f771454d25facf14af79da4e8e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 19 Aug 2020 15:24:09 +0200 Subject: [PATCH] Fix building with CMake > 3, GCC 8 and old Boost version (e.g. CentOS 7 with cmake3 and gcc8) --- CMakeLists.txt | 6 ++++++ .../acquisition/galileo_e5b_pcps_acquisition_test.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8abd974d8..f06c4d257 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -579,6 +579,7 @@ if(NOT (GNURADIO_VERSION VERSION_LESS "3.8")) endif() + ################################################################################ # Log4cpp - http://log4cpp.sourceforge.net/ ################################################################################ @@ -839,6 +840,11 @@ if(Boost_VERSION_STRING VERSION_LESS 1.70.0) ) endif() +# Fox for CentOS 7 with cmake3 and gcc8 +if(Boost_VERSION_STRING VERSION_LESS "1.60") + set(USE_GENERIC_LAMBDAS OFF) +endif() + # Fix for Boost >= 1.73 if(Boost_VERSION_STRING VERSION_GREATER 1.72.99) set(USE_BOOST_BIND_PLACEHOLDERS ON) diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5b_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5b_pcps_acquisition_test.cc index 72b6cb483..d115ab84a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5b_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5b_pcps_acquisition_test.cc @@ -111,7 +111,7 @@ GalileoE5bPcpsAcquisitionTest_msg_rx::GalileoE5bPcpsAcquisitionTest_msg_rx(Concu #if HAS_GENERIC_LAMBDA [this](pmt::pmt_t&& PH1) { msg_handler_channel_events(PH1); }); #else -#if BOOST_173_OR_GREATER +#if USE_BOOST_BIND_PLACEHOLDERS boost::bind(&GalileoE5bPcpsAcquisitionTest_msg_rx::msg_handler_channel_events, this, boost::placeholders::_1)); #else boost::bind(&GalileoE5bPcpsAcquisitionTest_msg_rx::msg_handler_channel_events, this, _1));