Skip to content

Commit 66a729a

Browse files
authored
initial support emscripten build (#1170)
1 parent 42f847f commit 66a729a

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ option(ENABLE_XDGAUTOSTART "Enable xdg autostart desktop file installation" On)
3636
option(USE_FLATPAK_ICON "Use flatpak icon name for desktop files" Off)
3737
option(ENABLE_EMOJI "Enable emoji module" On)
3838
option(ENABLE_LIBUUID "Use libuuid for uuid generation" On)
39+
option(BUILD_SPELL_DICT "Build en_dict.fscd for English spell check" On)
3940
set(NO_PREEDIT_APPS "gvim.*,wps.*,wpp.*,et.*" CACHE STRING "Disable preedit for follwing app by default.")
4041

4142
if (ENABLE_EMOJI)

cmake/Fcitx5CompilerSettings.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(CMAKE_C_STANDARD 99)
88
set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}")
99
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}")
1010

11-
if(NOT APPLE)
11+
if(NOT APPLE AND NOT EMSCRIPTEN)
1212
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_SHARED_LINKER_FLAGS}")
1313
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined -Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}")
1414
endif()

src/lib/fcitx-utils/endian_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define _FCITX_UTILS_ENDIAN_P_H_
99

1010
#include <cstdint>
11-
#if defined(__linux__) || defined(__GLIBC__)
11+
#if defined(__linux__) || defined(__GLIBC__) || defined(__EMSCRIPTEN__)
1212
#include <endian.h>
1313
#elif defined(__APPLE__)
1414

src/modules/spell/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/spell.conf" DESTINATION "${FCITX_INST
1717
COMPONENT config)
1818
fcitx5_export_module(Spell TARGET spell BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS spell_public.h INSTALL)
1919

20+
if (BUILD_SPELL_DICT)
2021
set(DICT_COMP_SRC
2122
comp_spell_dict.cpp
2223
)
@@ -46,3 +47,4 @@ add_custom_command(
4647
"${SPELL_EN_DICT_SRC}" "${SPELL_EN_DICT}")
4748
add_custom_target(spell_en_dict ALL DEPENDS "${SPELL_EN_DICT}")
4849
install(FILES "${SPELL_EN_DICT}" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/spell")
50+
endif()

0 commit comments

Comments
 (0)