Browse Source

Fix MCP bridge build failure on windows.

chirpmodem-v8.1.0
Jon Beniston 3 weeks ago
parent
commit
9bcaa6ab98
  1. 7
      plugins/feature/mcpserver/bridge/CMakeLists.txt
  2. 13
      plugins/feature/mcpserver/bridge/run-tools-dump.cmake

7
plugins/feature/mcpserver/bridge/CMakeLists.txt

@ -91,6 +91,12 @@ if(BUILD_MCP_BUNDLE) @@ -91,6 +91,12 @@ if(BUILD_MCP_BUNDLE)
# This helper runs during the build, before macOS packaging rewrites library paths for
# the app bundle, so it needs the external-library build directories on its own rpath.
set_target_properties(sdrangel-mcp-tools-dump PROPERTIES BUILD_RPATH "${MACOS_EXTERNAL_LIBS_FIXUP}")
elseif(WIN32)
# The same on Windows: sdrbase needs the fftw and libsigmf DLLs, which are copied into
# bin/ by targets that nothing orders before this helper runs, so it loads them from
# where they come from. Joined with | because a ; would split the command argument
set(MCPTOOLSDUMP_DLL_DIRS "${FFTW3F_DLL_DIR}" "${LIBSIGMF_DLL_DIR}")
list(JOIN MCPTOOLSDUMP_DLL_DIRS "|" MCPTOOLSDUMP_DLL_PATH)
endif()
set(MCPTOOLSDUMP_TIMEOUT 60 CACHE STRING "Timeout in seconds for generating the MCP tool list")
@ -118,6 +124,7 @@ if(BUILD_MCP_BUNDLE) @@ -118,6 +124,7 @@ if(BUILD_MCP_BUNDLE)
"-DTOOLSDUMP=$<TARGET_FILE:sdrangel-mcp-tools-dump>"
"-DTOOLS_JSON=${MCPBRIDGE_BUNDLE_DIR}/server/tools.json"
"-DTOOLSDUMP_TIMEOUT=${MCPTOOLSDUMP_TIMEOUT}"
"-DTOOLSDUMP_DLL_PATH=${MCPTOOLSDUMP_DLL_PATH}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/run-tools-dump.cmake"
COMMAND ${CMAKE_COMMAND} -E rm -f "${MCPBRIDGE_BUNDLE_FILE}"
# Relative paths and a working directory, so that manifest.json lands at the root of

13
plugins/feature/mcpserver/bridge/run-tools-dump.cmake

@ -10,6 +10,19 @@ if(NOT TOOLSDUMP_TIMEOUT MATCHES "^[1-9][0-9]*$") @@ -10,6 +10,19 @@ if(NOT TOOLSDUMP_TIMEOUT MATCHES "^[1-9][0-9]*$")
message(FATAL_ERROR "TOOLSDUMP_TIMEOUT must be a positive integer")
endif()
# Windows only: directories of DLLs that may not have been copied beside the helper yet,
# separated by |
if(TOOLSDUMP_DLL_PATH)
string(REPLACE "|" ";" toolsdump_dll_dirs "${TOOLSDUMP_DLL_PATH}")
foreach(dll_dir IN LISTS toolsdump_dll_dirs)
if(dll_dir)
file(TO_NATIVE_PATH "${dll_dir}" dll_dir)
set(ENV{PATH} "${dll_dir};$ENV{PATH}")
endif()
endforeach()
message(STATUS "mcpbundle: DLL search path adds ${TOOLSDUMP_DLL_PATH}")
endif()
message(STATUS "mcpbundle: starting ${TOOLSDUMP}")
message(STATUS "mcpbundle: output ${TOOLS_JSON}; timeout ${TOOLSDUMP_TIMEOUT}s")
get_filename_component(toolsdump_working_directory "${TOOLS_JSON}" DIRECTORY)

Loading…
Cancel
Save