Skip to content

Commit

Permalink
Update build parameters, build new version. V0.1.8 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aksem authored Mar 29, 2022
1 parent 54c14e8 commit 5083957
Show file tree
Hide file tree
Showing 9 changed files with 1,834 additions and 3,497 deletions.
2,587 changes: 1 addition & 2,586 deletions dist/index.js

Large diffs are not rendered by default.

Binary file modified dist/libavoid.wasm
Binary file not shown.
2,471 changes: 1,691 additions & 780 deletions examples/lib/libavoid.js

Large diffs are not rendered by default.

Binary file modified examples/lib/libavoid.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/lib/libavoid.wasm.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "libavoid-js",
"version": "0.1.5",
"version": "0.1.8",
"description": "JS port of libavoid library",
"main": "dist/index.js",
"types": "typings/libavoid.d.ts",
"scripts": {
"build": "webpack",
"build": "webpack --mode=production",
"api-docs": "jsdoc -c jsdoc.conf.js -d ./api_docs_build/ build/generated_debug/glue.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down
243 changes: 119 additions & 124 deletions src/generated/libavoid.js

Large diffs are not rendered by default.

Binary file modified src/generated/libavoid.wasm
Binary file not shown.
24 changes: 20 additions & 4 deletions tools/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ def compile(debug=False):
except FileExistsError:
...

post_js_args = ''
post_js_args = f' --post-js ./{generated_sources_dir}/glue.js'
compiler_sources = ''
post_js_args += f' --post-js ./{generated_sources_dir}/glue.js'
for source_file in SOURCE_FILES:
compiler_sources += f' ./adaptagrams/cola/libavoid/{source_file}.cpp'

Expand All @@ -107,20 +106,37 @@ def compile(debug=False):
if debug:
args += ' -g4 --source-map-base http://localhost:8080/lib/ -s RUNTIME_LOGGING=1'
else:
args += '-g2 -O3'
args += '-O3'

execute_command(f"""
docker run \
--rm \
-v {str(pwd)}:/src -w /src/ \
-u {os.getuid()}:{os.getgid()} \
emscripten/emsdk:3.1.8 \
emcc {args} --closure 1 -s LLD_REPORT_UNDEFINED -flto -s FILESYSTEM=0 -s MODULARIZE=1 -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0 -s EXPORT_NAME="'initAvoidModule'" -s ALLOW_TABLE_GROWTH=1 --no-entry -Iadaptagrams/cola/ -I{generated_sources_dir}/ {compiler_sources} {post_js_args} -o {dist_dir_name}/libavoid.js
emcc {args} \
--closure 1 \
-s LLD_REPORT_UNDEFINED \
-flto \
-s FILESYSTEM=0 \
-s MODULARIZE=1 \
-s EXPORT_ES6=1 \
-s USE_ES6_IMPORT_META=0 \
-s EXPORT_NAME="'initAvoidModule'" \
-s ALLOW_TABLE_GROWTH=1 \
-s ENVIRONMENT="web" \
--no-entry \
-Iadaptagrams/cola/ \
-I{generated_sources_dir}/ \
{compiler_sources} \
{post_js_args} \
-o {dist_dir_name}/libavoid.js
""", logger)
# -s CLOSURE_WARNINGS=error .. will show all warnings and errors, but also of emcc
# -g .. for debug, -g4 is max level with source maps for browser
# EXPORT_NAME ... explanation: https://stackoverflow.com/a/30153119
# source-map-base is required for browser recognition of source maps
# -s STRICT=1 \


def main():
Expand Down

0 comments on commit 5083957

Please sign in to comment.