Skip to content

Commit b2e7c7a

Browse files
committed
make shared library loader optional
1 parent 10f481a commit b2e7c7a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ option(ENABLE_EMOJI "Enable emoji module" On)
3939
option(ENABLE_LIBUUID "Use libuuid for uuid generation" On)
4040
option(BUILD_SPELL_DICT "Build en_dict.fscd for English spell check" On)
4141
option(BUILD_SHARED_LIBS "Build library as shared libs" On)
42+
option(ENABLE_DL "Enable dynamic loading addons" On)
4243
set(NO_PREEDIT_APPS "gvim.*,wps.*,wpp.*,et.*" CACHE STRING "Disable preedit for follwing app by default.")
4344
set(EVENT_LOOP_BACKEND "auto" CACHE STRING "Set the underlying event loop implementation, valid values are auto,systemd,libuv,none")
4445

@@ -116,7 +117,10 @@ endif()
116117
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
117118
find_package(LibKVM REQUIRED)
118119
endif()
119-
find_package(DL REQUIRED)
120+
121+
if(NOT ENABLE_DL)
122+
add_definitions("-DFCITX_NO_DL")
123+
endif()
120124

121125
if (NOT TARGET LibIntl::LibIntl)
122126
find_package(LibIntl REQUIRED)

src/lib/fcitx/addonmanager.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ void AddonManager::unregisterLoader(const std::string &name) {
250250
}
251251

252252
void AddonManager::registerDefaultLoader(StaticAddonRegistry *registry) {
253+
#ifndef FCITX_NO_DL
253254
registerLoader(std::make_unique<SharedLibraryLoader>());
255+
#endif
254256
if (registry) {
255257
registerLoader(std::make_unique<StaticLibraryLoader>(registry));
256258
}

0 commit comments

Comments
 (0)