From 7ad82f19a0231e11e58763a6202622089b353dab Mon Sep 17 00:00:00 2001 From: Sebastian Weyer <50481737+DocSepp@users.noreply.github.com> Date: Tue, 30 Jan 2024 22:05:31 +0100 Subject: [PATCH] CMakeLists.txt: exclude h_routed_npdu.c when BAC_ROUTING=OFF (#562) Fixed CMakeLists.txt: to exclude h_routed_npdu.c when BAC_ROUTING=OFF When calling cmake with -DBAC_ROUTING=OFF, basic/object/gateway/gw_device.c is correctly excluded from the build. It does contain however the definition for the functions Routed_Device_GetNext and Routed_Device_Is_Valid_Network, both of which are called in the routed_apdu_handler function of basic/npdu/h_routed_npdu.c. This is fine during compilation since these functions' prototypes are declared in basic/object/device.h but linking will fail. Thus, make the compilation of h_routed_npdu.c conditional depending on the value of BAC_ROUTING. Signed-off-by: Sebastian Weyer Co-authored-by: Sebastian Weyer --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cd1cf0b..094cd266 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,8 +161,8 @@ add_library(${PROJECT_NAME} src/bacnet/basic/binding/address.h src/bacnet/basic/npdu/h_npdu.c src/bacnet/basic/npdu/h_npdu.h - src/bacnet/basic/npdu/h_routed_npdu.c - src/bacnet/basic/npdu/h_routed_npdu.h + $<$:src/bacnet/basic/npdu/h_routed_npdu.c> + $<$:src/bacnet/basic/npdu/h_routed_npdu.h> src/bacnet/basic/npdu/s_router.c src/bacnet/basic/npdu/s_router.h src/bacnet/basic/object/access_credential.c