chore: make doc and data optional for cross build#789
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #789 +/- ##
=======================================
Coverage 92.06% 92.06%
=======================================
Files 37 37
Lines 9252 9252
=======================================
Hits 8518 8518
Misses 734 734 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks! I'm very interested in your wasm build and how you plan to use it! Does the wasm build work out of the box? |
I've deployed wasm build of fcitx5-chewing to https://fcitx-contrib.github.io/online/
Wasm build could have multi-thread disabled or enabled. I choose to disable it so that it can be ran without specific HTTP response headers (COEP and COOP) set by server, in the hope that it can be embedded in more websites. That means for every usage of multi-thread, I have to patch it to be single-thread. See my current patch for libchewing as an example, in which I change the thread spawn to a direct function call. |
|
Thanks. This is so cool! If you'd like to contribute a wasm patch I will merge it. I was planning to add a wasm demo on the website anyway 😄 P.S. I played a bit and it seems the current version is using built-in fallback dictionary instead of the files from the plugin. |

libchewing uses chewing-cli to generate binary dictionaries from text files. When cross build (e.g. for wasm), the cli is not a natively-executable program, so the generation step needs to be skipped. Dictionaries can still be built natively and copied to wasm package.
The PR introduces
BUILD_DATAthat defaults toONso that current behavior is preserved and it's easier to skip the data generation step.BUILD_DOCis not as important asBUILD_DATAbut also provides some convenience, as I'm not distributing man pages to the website that runs chewing wasm.