Skip to content

Commit

Permalink
Support no server build for fcitx
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Jan 20, 2025
1 parent a68cc09 commit b3bb0d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (BUILD_TOOL)
add_subdirectory(gui)
endif()

if (BUILD_SERVER)
if (BUILD_SERVER AND ENABLE_SERVER)
add_subdirectory(server)
endif()

Expand Down
19 changes: 16 additions & 3 deletions fcitx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ add_library(fcitx5-mozc MODULE
${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_client_pool.cc
${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_engine_factory.cc
${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_engine.cc
${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_ipc_client.cc
${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_response_parser.cc
${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_state.cc
)

set_target_properties(fcitx5-mozc PROPERTIES PREFIX "")

target_link_libraries(fcitx5-mozc
Expand All @@ -20,8 +20,21 @@ target_link_libraries(fcitx5-mozc
mozc::base::vlog
mozc::base::process
mozc::base::util
mozc::base::init_mozc
mozc::client::client)
mozc::base::init_mozc)

if (ENABLE_SERVER)
target_sources(fcitx5-mozc PRIVATE ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_ipc_client.cc)
target_link_libraries(fcitx5-mozc mozc::client::client)
else()
target_sources(fcitx5-mozc PRIVATE ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_direct_client.cc)
target_link_libraries(fcitx5-mozc
mozc::session::session_usage_observer
mozc::engine::engine
mozc::session::key_info_util
mozc::session::session_handler
mozc::data_manager::oss::oss_data_manager)
endif()

install(TARGETS fcitx5-mozc DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5")
install(FILES ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc-addon.conf RENAME mozc.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon"
COMPONENT config)
Expand Down

0 comments on commit b3bb0d3

Please sign in to comment.