From 2dca581741b6357fffbf87610c17a4985cc32ff1 Mon Sep 17 00:00:00 2001 From: Robert Falkenberg Date: Mon, 21 Feb 2022 12:38:27 +0100 Subject: [PATCH] srsran_rf: only build each plugin when found AND enabled Since [PLUGINNAME]_FOUND are cached variables, some plugins were always built if they were found once, regardless if the current value of ENABLE_[PLUGINNAME] --- lib/src/phy/rf/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/phy/rf/CMakeLists.txt b/lib/src/phy/rf/CMakeLists.txt index 3581d5ab0..7374ba209 100644 --- a/lib/src/phy/rf/CMakeLists.txt +++ b/lib/src/phy/rf/CMakeLists.txt @@ -24,7 +24,7 @@ if(RF_FOUND) endif (ENABLE_RF_PLUGINS) # RF plugins - if (UHD_FOUND) + if (UHD_FOUND AND ENABLE_UHD) add_definitions(-DENABLE_UHD) set(SOURCES_UHD rf_uhd_imp.cc) if (ENABLE_RF_PLUGINS) @@ -50,7 +50,7 @@ if(RF_FOUND) endif(UHD_ENABLE_CUSTOM_RFNOC) endif (UHD_FOUND) - if (BLADERF_FOUND) + if (BLADERF_FOUND AND ENABLE_BLADERF) add_definitions(-DENABLE_BLADERF) set(SOURCES_BLADE rf_blade_imp.c) if (ENABLE_RF_PLUGINS) @@ -80,7 +80,7 @@ if(RF_FOUND) install(TARGETS srsran_rf_soapy DESTINATION ${LIBRARY_DIR}) endif (SOAPYSDR_FOUND AND ENABLE_SOAPYSDR) - if(SKIQ_FOUND) + if(SKIQ_FOUND AND ENABLE_SKIQ) add_executable(skiq_pps_test skiq_pps_test.c) target_link_libraries(skiq_pps_test ${SKIQ_LIBRARIES} rt pthread m) add_definitions(-DENABLE_SIDEKIQ) @@ -97,7 +97,7 @@ if(RF_FOUND) install(TARGETS srsran_rf_skiq DESTINATION ${LIBRARY_DIR}) endif(SKIQ_FOUND) - if (ZEROMQ_FOUND) + if (ZEROMQ_FOUND AND ENABLE_ZEROMQ) add_definitions(-DENABLE_ZEROMQ) set(SOURCES_ZMQ rf_zmq_imp.c rf_zmq_imp_tx.c rf_zmq_imp_rx.c) if (ENABLE_RF_PLUGINS)