mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 02:17:37 +08:00
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:
@@ -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()
|
||||||
|
Reference in New Issue
Block a user