Skip to content

Commit

Permalink
make shared library loader optional
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Dec 8, 2024
1 parent 10f481a commit b2e7c7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ option(ENABLE_EMOJI "Enable emoji module" On)
option(ENABLE_LIBUUID "Use libuuid for uuid generation" On)
option(BUILD_SPELL_DICT "Build en_dict.fscd for English spell check" On)
option(BUILD_SHARED_LIBS "Build library as shared libs" On)
option(ENABLE_DL "Enable dynamic loading addons" On)
set(NO_PREEDIT_APPS "gvim.*,wps.*,wpp.*,et.*" CACHE STRING "Disable preedit for follwing app by default.")
set(EVENT_LOOP_BACKEND "auto" CACHE STRING "Set the underlying event loop implementation, valid values are auto,systemd,libuv,none")

Expand Down Expand Up @@ -116,7 +117,10 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
find_package(LibKVM REQUIRED)
endif()
find_package(DL REQUIRED)

if(NOT ENABLE_DL)
add_definitions("-DFCITX_NO_DL")
endif()

if (NOT TARGET LibIntl::LibIntl)
find_package(LibIntl REQUIRED)
Expand Down
2 changes: 2 additions & 0 deletions src/lib/fcitx/addonmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ void AddonManager::unregisterLoader(const std::string &name) {
}

void AddonManager::registerDefaultLoader(StaticAddonRegistry *registry) {
#ifndef FCITX_NO_DL
registerLoader(std::make_unique<SharedLibraryLoader>());
#endif
if (registry) {
registerLoader(std::make_unique<StaticLibraryLoader>(registry));
}
Expand Down

0 comments on commit b2e7c7a

Please sign in to comment.