build(flatpak): add plugin target building a runtime flatpak provider

Introduces the flatpak-provider-plugin module target, producing
libflatpak-provider.so and copying it next to the executable so
PluginManager can load it at runtime.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTV committed 2026-08-29 20:34:37 +02:00
1 parent 48ed73bdba
commit bd13a1404b
1 file changed
+17
+17
View File
@@ -93,3 +93,20 @@ if(FWS_BUILD_EXAMPLE_PLUGIN)
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:example-provider-plugin>
$<TARGET_FILE_DIR:PacManager>/plugins/)
endif()
# Flatpak provider plugin. Flatpak ships as an external plugin (not compiled
# into the binary): the produced .so is copied next to the executable and
# discovered at runtime by PluginManager, so it can be updated or removed
# independently of the core app.
add_library(flatpak-provider-plugin MODULE
plugins/flatpak-provider/flatpak-provider.cpp
plugins/flatpak-provider/flatpak-manager.cpp)
target_include_directories(flatpak-provider-plugin PRIVATE include plugins/flatpak-provider)
set_target_properties(flatpak-provider-plugin PROPERTIES
OUTPUT_NAME "flatpak-provider"
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
add_custom_command(TARGET flatpak-provider-plugin POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:PacManager>/plugins
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:flatpak-provider-plugin>
$<TARGET_FILE_DIR:PacManager>/plugins/)