-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompile.sh
More file actions
37 lines (29 loc) · 744 Bytes
/
Compile.sh
File metadata and controls
37 lines (29 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# EMSDK enviroment file path
emsdk_shFile="./../../emsdk_env.sh"
#output directory for Wasm File
output_directory="./Engine/dist/"
output_fileName="Renderer.js"
#list of files to compile
filesToCompile=(
"./Engine/Renderer/RendererAPI.cpp"
"./Engine/Renderer/Material.cpp"
"./Engine/Renderer/Mesh.cpp"
"./Engine/Math/Vector3.cpp"
"./Engine/Math/Matrix4.cpp")
t="emcc --bind -o ${output_directory}${output_fileName} ${filesToCompile[*]} -s ALLOW_MEMORY_GROWTH=1 -s USE_WEBGL2=1 -s FULL_ES3=1 -s WASM=1 -s NO_EXIT_RUNTIME=1 -std=c++1z"
while getopts ":sb" option;
do
case $option in
s)
echo setting up the environment
source ${emsdk_shFile}
;;
b)
eval ${t}
;;
*)
echo "invalid option $OPTARG"
;;
esac
done