Fix building when using C++11

Update changelog
This commit is contained in:
Carles Fernandez 2021-02-16 14:27:46 +01:00
parent ec7b4cc537
commit f703990a09
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
28 changed files with 114 additions and 17 deletions

View File

@ -36,6 +36,9 @@ SPDX-FileCopyrightText: 2011-2021 Carles Fernandez-Prades <carles.fernandez@cttc
asking them to sign the CLA document).
- Improved handling of change in GNU Radio 3.9 FFT API.
- Improved handling of the filesystem library.
- Added an abstract class `SignalSourceInterface` and a common base class
`SignalSourceBase`, which allow to remove a lot of duplicated code in Signal
Source blocks, and further abstract file-based interfaces behind them.
- Do not apply clang-tidy fixes to protobuf-generated headers.
- Refactored private implementation of flow graph connection and disconnection
for improved source code readability.

View File

@ -31,6 +31,7 @@ set(GNSS_SPLIBS_SOURCES
item_type_helpers.cc
pass_through.cc
short_x2_to_cshort.cc
gnss_sdr_string_literals.cc
)
set(GNSS_SPLIBS_HEADERS
@ -61,6 +62,7 @@ set(GNSS_SPLIBS_HEADERS
item_type_helpers.h
pass_through.h
short_x2_to_cshort.h
gnss_sdr_string_literals.h
)
if(ENABLE_OPENCL)

View File

@ -0,0 +1,37 @@
/*!
* \file gnss_sdr_string_literals.cc
* \brief This file implements the ""s operator for std::string in C++11, and
* puts it into the std::string_literals namespace. This is already implemented
* in C++14, so this is only compiled when using C++11. The .cc file is required
* for avoiding the duplication of symbols.
*
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
*
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#include "gnss_sdr_string_literals.h"
#if __cplusplus == 201103L
namespace std
{
namespace string_literals
{
std::string operator"" s(const char* str, std::size_t len)
{
return std::string(str, len);
};
} // namespace string_literals
} // namespace std
#endif // __cplusplus == 201103L

View File

@ -0,0 +1,48 @@
/*!
* \file gnss_sdr_string_literals.h
* \brief This file implements the ""s operator for std::string in C++11, and
* puts it into the std::string_literals namespace. This is already implemented
* in C++14, so this is only compiled when using C++11. The .cc file is required
* for avoiding the duplication of symbols.
*
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
*
*
* -----------------------------------------------------------------------------
*
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
* This file is part of GNSS-SDR.
*
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
* SPDX-License-Identifier: GPL-3.0-or-later
*
* -----------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_STRING_LITERALS_H
#define GNSS_SDR_STRING_LITERALS_H
/** \addtogroup Algorithms_Library
* \{ */
/** \addtogroup Algorithm_libs algorithms_libs
* \{ */
#if __cplusplus == 201103L
#include <cstddef>
#include <string>
namespace std
{
namespace string_literals
{
std::string operator"" s(const char* str, std::size_t len);
} // namespace string_literals
} // namespace std
#endif // __cplusplus == 201103L
/** \} */
/** \} */
#endif // GNSS_SDR_STRING_LITERALS_H

View File

@ -160,6 +160,7 @@ target_link_libraries(signal_source_adapters
Gnuradio::blocks
signal_source_gr_blocks
PRIVATE
algorithms_libs
gnss_sdr_flags
core_system_parameters
Glog::glog
@ -172,18 +173,6 @@ if(GNURADIO_USES_STD_POINTERS)
)
endif()
# This should really be at a higher level and apply universally to the
# build system
if(FILESYSTEM_FOUND)
target_compile_definitions(signal_source_adapters PUBLIC -DHAS_STD_FILESYSTEM=1)
if(find_experimental)
target_compile_definitions(signal_source_adapters PUBLIC -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
endif()
target_link_libraries(signal_source_adapters PUBLIC std::filesystem)
else()
target_link_libraries(signal_source_adapters PUBLIC Boost::filesystem Boost::system)
endif()
if(ENABLE_RAW_UDP AND PCAP_FOUND)
target_link_libraries(signal_source_adapters
PRIVATE

View File

@ -25,6 +25,7 @@
#include "ad9361_manager.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include "uio_fpga.h"
#include <glog/logging.h>
#include <iio.h>

View File

@ -17,6 +17,7 @@
#include "custom_udp_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <iostream>

View File

@ -17,6 +17,7 @@
*/
#include "file_signal_source.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
using namespace std::string_literals;

View File

@ -18,6 +18,7 @@
#include "configuration_interface.h"
#include "gnss_sdr_filesystem.h"
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <cmath> // ceil, floor

View File

@ -18,6 +18,7 @@
#include "flexiband_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <teleorbit/frontend.h>

View File

@ -22,6 +22,7 @@
#include "ad9361_manager.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <algorithm> // for max

View File

@ -16,6 +16,7 @@
#include "gn3s_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gn3s/gn3s_source_cc.h>

View File

@ -16,6 +16,7 @@
#include "labsat_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include "labsat23_source.h"
#include <glog/logging.h>

View File

@ -18,6 +18,7 @@
#include "multichannel_file_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <exception>

View File

@ -17,6 +17,7 @@
*/
#include "nsr_file_signal_source.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
using namespace std::string_literals;

View File

@ -18,6 +18,7 @@
#include "osmosdr_signal_source.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>

View File

@ -18,6 +18,7 @@
#include "plutosdr_signal_source.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <iostream>

View File

@ -17,6 +17,7 @@
#include "raw_array_signal_source.h"
#include "concurrent_queue.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <pmt/pmt.h>

View File

@ -19,6 +19,7 @@
#include "rtl_tcp_signal_source.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <cstdint>

View File

@ -20,6 +20,7 @@
#include "signal_source_base.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <utility> // move

View File

@ -16,6 +16,7 @@
*/
#include "spir_file_signal_source.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>

View File

@ -18,6 +18,7 @@
#include "spir_gss6450_file_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <exception>
#include <fstream>

View File

@ -16,6 +16,7 @@
*/
#include "two_bit_cpx_file_signal_source.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
using namespace std::string_literals;

View File

@ -18,6 +18,7 @@
#include "two_bit_packed_file_signal_source.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include <glog/logging.h>
#include <gnuradio/blocks/char_to_float.h>

View File

@ -17,6 +17,7 @@
#include "uhd_signal_source.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h"
#include "gnss_sdr_string_literals.h"
#include "gnss_sdr_valve.h"
#include <glog/logging.h>
#include <uhd/exception.hpp>

View File

@ -27,6 +27,7 @@
#define GNSS_SDR_SIGNAL_SOURCE_INTERFACE_H
#include "gnss_block_interface.h"
#include <glog/logging.h>
/** \addtogroup Core
* \{ */
@ -42,7 +43,6 @@
* implemented by that class or a parent class.
*/
#include <glog/logging.h>
class SignalSourceInterface : public GNSSBlockInterface
{
public:

View File

@ -151,6 +151,7 @@ target_link_libraries(core_receiver
PUBLIC
core_libs
PRIVATE
algorithms_libs
core_monitor
signal_source_adapters
data_type_adapters
@ -169,8 +170,6 @@ target_link_libraries(core_receiver
Armadillo::armadillo
)
target_include_directories(core_receiver PRIVATE ${CMAKE_SOURCE_DIR}/src/algorithms/libs)
if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(core_receiver
PRIVATE -DARMA_NO_BOUND_CHECKING=1

View File

@ -68,6 +68,7 @@
#include "glonass_l2_ca_telemetry_decoder.h"
#include "gnss_block_interface.h"
#include "gnss_sdr_make_unique.h"
#include "gnss_sdr_string_literals.h"
#include "gps_l1_ca_dll_pll_tracking.h"
#include "gps_l1_ca_kf_tracking.h"
#include "gps_l1_ca_pcps_acquisition.h"
@ -204,8 +205,6 @@ auto findRole(ConfigurationInterface const* configuration, std::string const& ba
}
return role;
};
} // namespace