Skip to content

Commit

Permalink
#31 Add comment on --embed-file vs. --preload-file
Browse files Browse the repository at this point in the history
  • Loading branch information
hatapitk committed Nov 3, 2017
1 parent fb6bc94 commit a632ed3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libvoikko/js/build.sh
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

0 comments on commit a632ed3

Please sign in to comment.