From 3ca9c412d26fde6afaae605e7fcbe08706341f94 Mon Sep 17 00:00:00 2001 From: BlackAngelTV Date: Wed, 30 Sep 2026 20:26:52 +0200 Subject: [PATCH] Chore(lib): add lib for build PLUGIN --- .gitignore | 4 ++++ CMakeLists.txt | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8dca703..14947f8 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,7 @@ desktop.ini # Freebuff .freebuff/ + +# Local, unversioned plugin experiments +local-plugins/ +*.fwspacm diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c269b6..b435fd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,12 @@ set(HEADERS add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}) +# External addons are shared libraries resolved against the running executable, +# so its symbols have to be in the dynamic symbol table (ENABLE_EXPORTS adds +# -rdynamic). Without it a plugin can implement the IPlugin contract but cannot +# call back into AppCore or the pages, which is what a UI addon needs to act. +set_target_properties(${PROJECT_NAME} PROPERTIES ENABLE_EXPORTS ON) + target_include_directories(${PROJECT_NAME} PRIVATE include pages pages/base pages/packages pages/overview pages/system pages/extensions include/sdk logging preferences history archive update plugins providers core app) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets Qt6::Network ZLIB::ZLIB) @@ -307,7 +313,7 @@ option(FWS_BUILD_AUR_PLUGIN "Build the AUR provider plugin" ON) option(FWS_BUILD_EXAMPLE_PLUGIN "Build the example external provider plugin" OFF) # Optional example addon plugin: a non-provider extension (see -# plugins/example-addon) proving that plugins can be anything written in C++, +# providers/example-addon) proving that plugins can be anything written in C++, # not just package managers. Built next to the executable like any external # plugin. option(FWS_BUILD_EXAMPLE_ADDON "Build the example addon plugin" OFF) @@ -343,7 +349,7 @@ if(FWS_BUILD_AUR_PLUGIN) endif() if(FWS_BUILD_EXAMPLE_PLUGIN) - add_library(example-provider-plugin MODULE plugins/example-provider/example-provider.cpp) + add_library(example-provider-plugin MODULE providers/example-provider/example-provider.cpp) target_include_directories(example-provider-plugin PRIVATE include include/sdk logging preferences history archive update plugins providers core app) set_target_properties(example-provider-plugin PROPERTIES OUTPUT_NAME "sample-provider" @@ -356,7 +362,7 @@ if(FWS_BUILD_EXAMPLE_PLUGIN) endif() if(FWS_BUILD_EXAMPLE_ADDON) - add_library(example-addon-plugin MODULE plugins/example-addon/example-addon.cpp) + add_library(example-addon-plugin MODULE providers/example-addon/example-addon.cpp) target_include_directories(example-addon-plugin PRIVATE include include/sdk logging preferences history archive update plugins providers core app) # The demo addon attaches Qt widgets, so it links the widget module like # the host application.