From 60413b2c1b13d50846265f1d1d728f8f124a4554 Mon Sep 17 00:00:00 2001 From: duongtd Date: Tue, 11 Aug 2026 16:04:36 +0700 Subject: [PATCH] fix: emit standalone .so to build root so PluginLoaderHelper finds action handlers Co-Authored-By: Claude Fable 5 --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 608d9ce..ac2857d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,6 +231,14 @@ else() ${TF3_LIBRARY} ) + # .so phải nằm ở root build dir như mission_adapters/recovery_core — PluginLoaderHelper chỉ tìm + # theo PNKX_NAV_CORE_LIBRARY_PATH / build dir / devel/lib, không quét thư mục con của build tree. + set_target_properties(action_core PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} + BUILD_RPATH "${CMAKE_BINARY_DIR}" + INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" + ) + endif() @@ -297,6 +305,14 @@ function(add_action_core_plugin target source) ${CMAKE_DL_LIBS} ${TF3_LIBRARY} ) + + # Handler nạp qua Boost.DLL theo `library_path` trong YAML — .so phải ra root build dir, + # nếu không PluginLoaderHelper báo "Library not found for symbol" dù build xanh. + set_target_properties(${target} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} + BUILD_RPATH "${CMAKE_BINARY_DIR}" + INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" + ) endif() set(ACTION_CORE_PLUGIN_TARGETS