From c00699257baca1d96f5e50ad1292f6bc857c66be Mon Sep 17 00:00:00 2001 From: duongtd Date: Tue, 17 Nov 2026 20:36:12 +0700 Subject: [PATCH] build: add BUILD_ROBOT_SBPL_TESTS option, off by default test_sbpl and test_adjacency_list were always built, also in the standalone pnkx_nav_core build that is deployed to the robot. Enable them with -DBUILD_ROBOT_SBPL_TESTS=ON. --- CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 971984e..cb5df2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,8 +91,15 @@ install(EXPORT robot_sbpl-targets NAMESPACE robot_sbpl:: DESTINATION lib/cmake/robot_sbpl) -add_executable(test_sbpl src/test/main.cpp) -target_link_libraries(test_sbpl robot_sbpl) +# Test programs are OFF by default: the standalone pnkx_nav_core build (the robot deployment +# path) pulls this directory in, and must not produce them. Enable with -DBUILD_ROBOT_SBPL_TESTS=ON +# to get test_sbpl (README.txt usage) and test_adjacency_list. +option(BUILD_ROBOT_SBPL_TESTS "Build the robot_sbpl test programs" OFF) -add_executable(test_adjacency_list src/test/test_adjacency_list.cpp) -target_link_libraries(test_adjacency_list robot_sbpl) +if(BUILD_ROBOT_SBPL_TESTS) + add_executable(test_sbpl src/test/main.cpp) + target_link_libraries(test_sbpl robot_sbpl) + + add_executable(test_adjacency_list src/test/test_adjacency_list.cpp) + target_link_libraries(test_adjacency_list robot_sbpl) +endif()