Skip to content

Commit 9fdbebd

Browse files
committed
Make flet_example Linux plugin portable
1 parent 387609c commit 9fdbebd

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/serious_python/example/flet_example/linux/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,21 @@ foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
123123
COMPONENT Runtime)
124124
endforeach(bundled_library)
125125

126+
# Link bundled libraries from plugins into main executable to enable dlopen
127+
# with only library name.
128+
# Will NOT be needed once: https://github.com/flutter/engine/pull/28525 lands in Flutter channel we are using
129+
# Alternative approach is to update plugin's RUNPATH before packaging:
130+
# chrpath -r \$ORIGIN ./build/linux/arm64/release/bundle/lib/libserious_python_linux_plugin.so
131+
foreach(plugin ${FLUTTER_PLUGIN_LIST})
132+
if(${plugin}_bundled_libraries)
133+
target_link_libraries(
134+
${BINARY_NAME}
135+
PRIVATE
136+
${${plugin}_bundled_libraries}
137+
)
138+
endif()
139+
endforeach(plugin)
140+
126141
# Fully re-copy the assets directory on each build to avoid having stale files
127142
# from a previous install.
128143
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")

0 commit comments

Comments
 (0)