Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
7305649a
Commit
7305649a
authored
Apr 26, 2016
by
Richard van der Hoff
Browse files
Make 'npm build' build the js lib
parent
4b26a09c
Changes
3
Hide whitespace changes
Inline
Side-by-side
javascript/.gitignore
View file @
7305649a
/exported_functions.json
/exported_functions.json
/node_modules
/npm-debug.log
/olm.js
/olm.js
javascript/build.py
View file @
7305649a
...
@@ -20,6 +20,8 @@ import sys
...
@@ -20,6 +20,8 @@ import sys
import
re
import
re
import
json
import
json
os
.
chdir
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))))
source_files
=
glob
.
glob
(
"src/*.cpp"
)
source_files
=
glob
.
glob
(
"src/*.cpp"
)
pre_js
,
=
glob
.
glob
(
"javascript/*pre.js"
)
pre_js
,
=
glob
.
glob
(
"javascript/*pre.js"
)
post_js
,
=
glob
.
glob
(
"javascript/*post.js"
)
post_js
,
=
glob
.
glob
(
"javascript/*post.js"
)
...
@@ -39,19 +41,22 @@ with open(exported_functions, "w") as json_file:
...
@@ -39,19 +41,22 @@ with open(exported_functions, "w") as json_file:
emcc
=
os
.
environ
.
get
(
"EMCC"
,
"emcc"
)
emcc
=
os
.
environ
.
get
(
"EMCC"
,
"emcc"
)
optimize_opts
=
os
.
environ
.
get
(
"OPTIMIZE_FLAGS"
,
"-O3"
)
compile_args
=
[
emcc
]
compile_args
=
[
emcc
]
compile_args
+=
optimize_opts
.
split
()
compile_args
+=
"""
compile_args
+=
"""
-O3
-Iinclude
-Iinclude
-Ilib
-Ilib
-std=c++11
-std=c++11
--closure 1
--closure 1
--memory-init-file 0
--memory-init-file 0
-s NO_FILESYSTEM=1
-s NO_FILESYSTEM=1
-s NO_BROWSER=1
-s INVOKE_RUN=0
-s INVOKE_RUN=0
"""
.
split
()
"""
.
split
()
# NO_BROWSER is kept for compatibility with emscripten 1.35.24, but is no
# longer needed.
compile_args
+=
(
"-s"
,
"NO_BROWSER=1"
)
compile_args
+=
source_files
compile_args
+=
source_files
compile_args
+=
(
"--pre-js"
,
pre_js
)
compile_args
+=
(
"--pre-js"
,
pre_js
)
compile_args
+=
(
"--post-js"
,
post_js
)
compile_args
+=
(
"--post-js"
,
post_js
)
...
@@ -66,4 +71,3 @@ def run(args):
...
@@ -66,4 +71,3 @@ def run(args):
subprocess
.
check_call
(
args
)
subprocess
.
check_call
(
args
)
run
(
compile_args
+
[
"-o"
,
library
])
run
(
compile_args
+
[
"-o"
,
library
])
javascript/package.json
View file @
7305649a
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
"README.md"
"README.md"
],
],
"scripts"
:
{
"scripts"
:
{
"build"
:
"./build.py"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
},
"repository"
:
{
"repository"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment