-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#31 Add comment on --embed-file vs. --preload-file
- Loading branch information
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#!/bin/sh | ||
|
||
emmake make | ||
emcc -g0 -O3 src/.libs/libvoikko.so.1.14.3 --memory-init-file 0 --closure 1 --preload-file 5 -o js/libvoikko.js --post-js js/libvoikko_api.js -s MODULARIZE="1" -s EXPORT_NAME="'Libvoikko'" -s NO_EXIT_RUNTIME="1" -s EXPORTED_FUNCTIONS="['_voikkoInit','_voikkoTerminate','_voikkoSetBooleanOption','_voikkoSetIntegerOption','_voikkoSpellCstr','_voikkoSuggestCstr','_voikkoHyphenateCstr','_voikkoFreeCstrArray','_voikkoFreeCstr','_voikkoNextTokenCstr','_voikkoNextSentenceStartCstr','_voikkoNextGrammarErrorCstr','_voikkoGetGrammarErrorCode','_voikkoGetGrammarErrorStartPos','_voikkoGetGrammarErrorLength','_voikkoGetGrammarErrorSuggestions','_voikkoFreeGrammarError','_voikkoGetGrammarErrorShortDescription','_voikkoFreeErrorMessageCstr','_voikko_list_dicts','_voikko_free_dicts','_voikko_dict_language','_voikko_dict_script','_voikko_dict_variant','_voikko_dict_description','_voikkoGetVersion','_voikkoAnalyzeWordCstr','_voikko_free_mor_analysis','_voikko_mor_analysis_keys','_voikko_mor_analysis_value_cstr','_voikko_free_mor_analysis_value_cstr']" | ||
|
||
# The following command uses --preload-file which will only work in browser environment. Use --embed-file instead for Node. | ||
# Also note that closure compiler may run out of memory when large dictionary files are embedded. | ||
emcc -g0 -O3 src/.libs/libvoikko.so.1.14.5 --memory-init-file 0 --closure 1 --preload-file 5 -o js/libvoikko.js --post-js js/libvoikko_api.js -s MODULARIZE="1" -s EXPORT_NAME="'Libvoikko'" -s NO_EXIT_RUNTIME="1" -s EXPORTED_FUNCTIONS="['_voikkoInit','_voikkoTerminate','_voikkoSetBooleanOption','_voikkoSetIntegerOption','_voikkoSpellCstr','_voikkoSuggestCstr','_voikkoHyphenateCstr','_voikkoFreeCstrArray','_voikkoFreeCstr','_voikkoNextTokenCstr','_voikkoNextSentenceStartCstr','_voikkoNextGrammarErrorCstr','_voikkoGetGrammarErrorCode','_voikkoGetGrammarErrorStartPos','_voikkoGetGrammarErrorLength','_voikkoGetGrammarErrorSuggestions','_voikkoFreeGrammarError','_voikkoGetGrammarErrorShortDescription','_voikkoFreeErrorMessageCstr','_voikko_list_dicts','_voikko_free_dicts','_voikko_dict_language','_voikko_dict_script','_voikko_dict_variant','_voikko_dict_description','_voikkoGetVersion','_voikkoAnalyzeWordCstr','_voikko_free_mor_analysis','_voikko_mor_analysis_keys','_voikko_mor_analysis_value_cstr','_voikko_free_mor_analysis_value_cstr']" | ||
cat js/libvoikko.js js/commonjs-footer.js > js/js-libvoikko.js |