mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
build(uxrce_dds_client): disable UDP profile on NuttX without CONFIG_NET (#28919)
The module only uses the UDP transport when CONFIG_NET or __PX4_POSIX is defined, but the Micro-XRCE-DDS-Client library was always built with UDP enabled. Match the library profile to the module's usage and drop the -Wno-error=implicit-function-declaration workaround for it. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
This commit is contained in:
1 parent
f908c91543
commit
4dc58bad90
1 file changed
+8
-6
@@ -61,11 +61,6 @@ else()
|
||||
set(cxx_flags_with_includes "${cxx_flags_with_includes} -I${dir}")
|
||||
endforeach()
|
||||
|
||||
# GCC 14 promotes implicit function declarations to hard errors; the
|
||||
# client's POSIX UDP transport (compiled but never linked on NuttX)
|
||||
# trips this via getaddrinfo/freeaddrinfo
|
||||
set(c_flags_with_includes "${c_flags_with_includes} -Wno-error=implicit-function-declaration")
|
||||
|
||||
set(lib_dir ${CMAKE_INSTALL_LIBDIR})
|
||||
if("${lib_dir}" STREQUAL "")
|
||||
set(lib_dir "lib")
|
||||
@@ -75,6 +70,13 @@ else()
|
||||
set(c_flags_with_includes "${c_flags_with_includes} -Wno-cast-align -D__PX4_NUTTX")
|
||||
endif()
|
||||
|
||||
# Match UXRCE_DDS_CLIENT_UDP in uxrce_dds_client.h: NuttX targets without networking have no UDP transport
|
||||
if(PX4_PLATFORM STREQUAL "nuttx" AND NOT CONFIG_NET)
|
||||
set(uclient_profile_udp OFF)
|
||||
else()
|
||||
set(uclient_profile_udp ON)
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(
|
||||
libmicroxrceddsclient_project
|
||||
@@ -90,7 +92,7 @@ else()
|
||||
-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
|
||||
-DUCLIENT_PIC:BOOL=OFF
|
||||
-DUCLIENT_PROFILE_TCP:BOOL=OFF
|
||||
-DUCLIENT_PROFILE_UDP:BOOL=ON
|
||||
-DUCLIENT_PROFILE_UDP:BOOL=${uclient_profile_udp}
|
||||
-DUCLIENT_PROFILE_SERIAL:BOOL=ON
|
||||
-DUCLIENT_PROFILE_DISCOVERY:BOOL=OFF
|
||||
-DUCLIENT_PROFILE_CUSTOM_TRANSPORT:BOOL=OFF
|
||||
|
||||
Reference in new issue
Block a user