From c98ac25ca6b88b27badf6a8f310b6ab38c255392 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Sat, 21 Mar 2026 18:19:45 +0100 Subject: [PATCH] makes compilation of the network driver depend on netxduo being built --- port/moonlight/CMakeLists.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/port/moonlight/CMakeLists.txt b/port/moonlight/CMakeLists.txt index a25ff5c..5edf9da 100644 --- a/port/moonlight/CMakeLists.txt +++ b/port/moonlight/CMakeLists.txt @@ -35,18 +35,24 @@ target_link_libraries(moonlight_platform_common PUBLIC c threadx) -add_library(moonlight_network_driver OBJECT - ${MOONLIGHT_SRC_DIR}/mnrs_network_driver.c) -target_link_libraries(moonlight_network_driver PUBLIC - moonlight_platform_defaults - c - threadx - netxduo) +if(DEFINED NETXDUO_CUSTOM_PORT) + add_library(moonlight_network_driver OBJECT + ${MOONLIGHT_SRC_DIR}/mnrs_network_driver.c) + target_link_libraries(moonlight_network_driver PUBLIC + moonlight_platform_defaults + c + threadx + netxduo) +endif() function(target_add_moonlight_platform TARGET) target_link_libraries(${TARGET} PRIVATE moonlight_platform_common) endfunction() function(target_add_moonlight_network_driver TARGET) + if(NOT TARGET moonlight_network_driver) + message(FATAL_ERROR "moonlight_network_driver requires netxduo to be available in this build") + endif() + target_link_libraries(${TARGET} PRIVATE moonlight_network_driver) endfunction()