From 7933567abf5408ce6c7ca50b192f0ff7ee073305 Mon Sep 17 00:00:00 2001 From: Strycher Date: Wed, 29 Jul 2026 22:06:14 -0400 Subject: [PATCH] fix(#445): port native-assets install robustness to Linux (Gemini review) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gemini review flagged that only Windows got the install-time guard; Linux kept the stock unconditional install(DIRECTORY), which errors at install time if the native-assets dir is absent (e.g. a local build with native assets disabled). Port the same install(CODE) EXISTS-guarded copy to linux/CMakeLists.txt. macOS has no CMakeLists (Xcode/CocoaPods), verified — the CI enable step covers it; the other half of the finding (presumed macos/CMakeLists.txt) does not apply. Citadel: meshcore-open-mkl --- linux/CMakeLists.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index d035aee..29ff90a 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -114,11 +114,20 @@ foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) COMPONENT Runtime) endforeach(bundled_library) -# Copy the native assets provided by the build.dart from all packages. +# Copy the native assets provided by build.dart hooks (e.g. sqlite3, llamadart) +# from all packages. Deferred to install time and guarded so a build where the +# directory does not exist (native assets built after configure, or disabled) +# does not error the way the stock unconditional install(DIRECTORY) would (#445). set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) +install(CODE " + if(EXISTS \"${NATIVE_ASSETS_DIR}\") + file(GLOB _native_asset_libs \"${NATIVE_ASSETS_DIR}*\") + if(_native_asset_libs) + file(INSTALL DESTINATION \"${INSTALL_BUNDLE_LIB_DIR}\" TYPE FILE + FILES \${_native_asset_libs}) + endif() + endif() +" COMPONENT Runtime) # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install.