From 310685cd20d9426f1f8038a442ff0ed7e208a7ea Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 28 Aug 2024 11:09:56 +0200 Subject: [PATCH] Allow building Ad936x_Custom_Signal_Source when gnuradio-iio is not available --- src/algorithms/signal_source/adapters/CMakeLists.txt | 2 +- src/algorithms/signal_source/libs/CMakeLists.txt | 2 +- src/core/receiver/CMakeLists.txt | 4 ++++ src/core/receiver/gnss_block_factory.cc | 6 ++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 9c0300522..48e18e5f3 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -259,7 +259,7 @@ if(LIBIIO_FOUND) ) endif() -if(ENABLE_AD9361 OR ENABLE_FMCOMMS2 OR ENABLE_PLUTOSDR) +if(ENABLE_AD9361 OR ENABLE_FMCOMMS2 OR ENABLE_PLUTOSDR OR ENABLE_AD936X_SDR) if(LIBAD9361_VERSION) if(LIBAD9361_VERSION VERSION_GREATER 0.1) target_compile_definitions(signal_source_adapters diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 9c39f7dc7..0df4f3303 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -113,7 +113,7 @@ if(GNURADIO_USES_STD_POINTERS) ) endif() -if(ENABLE_FMCOMMS2 OR ENABLE_AD9361 OR ENABLE_PLUTOSDR) +if(ENABLE_FMCOMMS2 OR ENABLE_AD9361 OR ENABLE_PLUTOSDR OR ENABLE_AD936X_SDR) target_link_libraries(signal_source_libs PUBLIC Iio::iio diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 604449390..ba945f69b 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -94,6 +94,10 @@ if(ENABLE_PLUTOSDR) target_compile_definitions(core_receiver PRIVATE -DPLUTOSDR_DRIVER=1) endif() +if(ENABLE_AD936X_SDR) + target_compile_definitions(core_receiver PRIVATE -DAD936X_SDR_DRIVER=1) +endif() + if(ENABLE_FMCOMMS2) target_compile_definitions(core_receiver PRIVATE -DFMCOMMS2_DRIVER=1) endif() diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 222b93cad..fceadefb9 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -163,6 +163,10 @@ #include "plutosdr_signal_source.h" #endif +#if AD936X_SDR_DRIVER +#include "ad936x_custom_signal_source.h" +#endif + #if FMCOMMS2_DRIVER #include "fmcomms2_signal_source.h" #endif @@ -807,6 +811,8 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams, queue); block = std::move(block_); } +#endif +#if PLUTOSDR_DRIVER || AD936X_SDR_DRIVER else if (implementation == "Ad936x_Custom_Signal_Source") { std::unique_ptr block_ = std::make_unique(configuration, role, in_streams,