cmake: fix cmake build for FreeModBus

fix cmake build for FreeModBus:

  1. nuttx-apps/modbus/mb.c:50:12: fatal error: mbrtu.h: No such file or directory
     50 | #  include "mbrtu.h"

  2. nuttx-apps/modbus/functions/mbutils.c:41:10: fatal error: port.h: No such file or directory
     41 | #include "port.h"

  3. various "undefined reference to" errors

Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
raiden00pl
2025-03-14 14:08:56 +01:00
committed by CeDeROM
parent 9e2775de98
commit e336ebad5e

View File

@@ -75,22 +75,27 @@ if(CONFIG_MODBUS)
# rtu/Make.defs # rtu/Make.defs
if(CONFIG_MB_RTU_ENABLED OR CONFIG_MB_RTU_MASTER) if(CONFIG_MB_RTU_ENABLED OR CONFIG_MB_RTU_MASTER)
list(APPEND rtu/mbcrc.c) list(APPEND CSRCS rtu/mbcrc.c)
if(CONFIG_MB_RTU_ENABLED) if(CONFIG_MB_RTU_ENABLED)
list(APPEND rtu/mbrtu.c) list(APPEND CSRCS rtu/mbrtu.c)
endif() endif()
if(CONFIG_MB_RTU_MASTER) if(CONFIG_MB_RTU_MASTER)
list(APPEND rtu/mbrtu_m.c) list(APPEND CSRCS rtu/mbrtu_m.c)
endif() endif()
endif() endif()
# tcp/Make.defs # tcp/Make.defs
if(CONFIG_MB_TCP_ENABLED) if(CONFIG_MB_TCP_ENABLED)
list(APPEND tcp/mbtcp.c) list(APPEND CSRCS tcp/mbtcp.c)
endif() endif()
# include private headers
target_include_directories(apps PRIVATE nuttx)
target_include_directories(apps PRIVATE rtu)
target_sources(apps PRIVATE ${CSRCS}) target_sources(apps PRIVATE ${CSRCS})
endif() endif()