Skip to content

Commit

Permalink
don't specify EMSCRIPTEN for stub event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Oct 27, 2024
1 parent abf15e4 commit dd0ad31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ if (NOT TARGET Systemd::Systemd)
pkg_get_variable(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "dbus-1" "system_bus_default_address")
endif()

if (NOT LIBUV_TARGET AND NOT EMSCRIPTEN)
if (NOT LIBUV_TARGET)
if (NOT (TARGET PkgConfig::LibUV))
pkg_check_modules(LibUV REQUIRED IMPORTED_TARGET "libuv")
pkg_check_modules(LibUV IMPORTED_TARGET "libuv")
endif()
set(LIBUV_TARGET PkgConfig::LibUV)
endif()
Expand Down
17 changes: 9 additions & 8 deletions src/lib/fcitx-utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ if (TARGET Systemd::Systemd)
set(FCITX_UTILS_SOURCES
${FCITX_UTILS_SOURCES}
event_sdevent.cpp)
elseif (EMSCRIPTEN)
list(APPEND FCITX_UTILS_SOURCES event_stub.cpp)
else()
elseif (TARGET ${LIBUV_TARGET})
set(FCITX_UTILS_SOURCES
${FCITX_UTILS_SOURCES}
event_libuv.cpp)
else()
list(APPEND FCITX_UTILS_SOURCES event_stub.cpp)
endif()

set(FCITX_UTILS_SOURCES
Expand Down Expand Up @@ -72,7 +72,6 @@ set(FCITX_UTILS_HEADERS
color.h
i18nstring.h
event.h
event_impl.h
eventdispatcher.h
library.h
cutf8.h
Expand Down Expand Up @@ -107,6 +106,10 @@ set(FCITX_UTILS_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/fcitxutils_export.h
)

if (NOT TARGET Systemd::Systemd AND NOT TARGET ${LIBUV_TARGET})
list(APPEND FCITX_UTILS_HEADERS event_impl.h)
endif()

set(FCITX_UTILS_DBUS_HEADERS
dbus/message.h
dbus/objectvtable.h
Expand Down Expand Up @@ -139,10 +142,8 @@ endif()

if (TARGET Systemd::Systemd)
target_link_libraries(Fcitx5Utils PRIVATE Systemd::Systemd)
else()
if (NOT EMSCRIPTEN)
target_link_libraries(Fcitx5Utils PRIVATE ${LIBUV_TARGET})
endif()
elseif (TARGET ${LIBUV_TARGET})
target_link_libraries(Fcitx5Utils PRIVATE ${LIBUV_TARGET})
if (ENABLE_DBUS)
target_link_libraries(Fcitx5Utils PRIVATE PkgConfig::DBus)
endif()
Expand Down

0 comments on commit dd0ad31

Please sign in to comment.