Update build
This commit is contained in:
parent
8892592ae9
commit
c9b770661a
3 changed files with 11 additions and 6 deletions
|
|
@ -8,7 +8,7 @@ if [[ -v 1 ]]; then
|
|||
if [ "$1" = "DEBUG" ]; then
|
||||
ODIN_FLAGS="-debug"
|
||||
elif [ "$1" = "RELEASE" ]; then
|
||||
ODIN_FLAGS="-o:speed"
|
||||
ODIN_FLAGS="-o:speed -extra-linker-flags:\"-Wl,--gc-sections\""
|
||||
else
|
||||
echo "Usage: <script> <DEBUG/RELEASE>"
|
||||
exit 1
|
||||
|
|
@ -22,3 +22,7 @@ mkdir -p $OUT_DIR
|
|||
odin build src/desktop -out:"$OUT_DIR/$EXE_NAME" $ODIN_FLAGS
|
||||
cp -R $ASSETS_DIR ./$OUT_DIR/
|
||||
echo "Desktop build created in ${OUT_DIR}"
|
||||
|
||||
if [ "$1" = "RELEASE" ]; then
|
||||
upx "$OUT_DIR/$EXE_NAME"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ if [[ -v 1 ]]; then
|
|||
if [ "$1" = "DEBUG" ]; then
|
||||
ODIN_FLAGS="-debug"
|
||||
elif [ "$1" = "RELEASE" ]; then
|
||||
ODIN_FLAGS=""
|
||||
ODIN_FLAGS="-o:size"
|
||||
else
|
||||
echo "Usage: <script> <DEBUG/RELEASE>"
|
||||
exit 1
|
||||
|
|
@ -42,7 +42,8 @@ files="$OUT_DIR/$WASM_OBJ_NAME $RAYLIB_PATH/wasm/libraylib.a $RAYLIB_PATH/wasm/l
|
|||
|
||||
# index_template.html contains the javascript code that calls the procedures in
|
||||
# source/main_web/main_web.odin
|
||||
flags="-O0 -sEXPORTED_RUNTIME_METHODS=['HEAPF32'] -sUSE_GLFW=3 -sWASM_BIGINT -sWARN_ON_UNDEFINED_SYMBOLS=0 --shell-file $INDEX_TEMPLATE_PATH --preload-file src/assets"
|
||||
EMCC_SETTINGS="-sEXPORTED_RUNTIME_METHODS=['HEAPF32'] -sUSE_GLFW=3 -sWASM_BIGINT -sWARN_ON_UNDEFINED_SYMBOLS=0"
|
||||
flags="-Wl,--gc-sections -Os $EMCC_SETTINGS --shell-file $INDEX_TEMPLATE_PATH --preload-file src/assets"
|
||||
|
||||
# For debugging: Add `-g` to `emcc` (gives better error callstack in chrome)
|
||||
emcc -o $OUT_DIR/index.html $files $flags
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ if [[ -v 1 ]]; then
|
|||
CFLAGS="-g"
|
||||
elif [ "$1" = "RELEASE" ]; then
|
||||
MAKE_FLAGS="RAYLIB_BUILD_MODE=RELEASE"
|
||||
CFLAGS="-Os"
|
||||
CFLAGS="-Os -ffunction-sections -fdata-sections"
|
||||
else
|
||||
echo "Usage: <script> <DEBUG/RELEASE>"
|
||||
exit 1
|
||||
|
|
@ -101,7 +101,7 @@ source $emsdk_env
|
|||
|
||||
pushd raylib/src
|
||||
echo "Compiling raylib static library for linux"
|
||||
make --silent RAYLIB_CONFIG_FLAGS="$CONFIG_FLAGS" $MAKE_FLAGS PLATFORM_OS=LINUX -B
|
||||
make --silent RAYLIB_CONFIG_FLAGS="$CONFIG_FLAGS" CUSTOM_CFLAGS="$CFLAGS" $MAKE_FLAGS PLATFORM_OS=LINUX -B
|
||||
mv libraylib.a "../../${linux_library_dest}"
|
||||
make --silent clean
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ make --silent clean
|
|||
# make --silent clean
|
||||
|
||||
echo "Compiling raylib static library for web"
|
||||
make --silent RAYLIB_CONFIG_FLAGS="$CONFIG_FLAGS" $MAKE_FLAGS PLATFORM=PLATFORM_WEB -B
|
||||
make --silent RAYLIB_CONFIG_FLAGS="$CONFIG_FLAGS" CUSTOM_CFLAGS="$CFLAGS" $MAKE_FLAGS PLATFORM=PLATFORM_WEB -B
|
||||
mv libraylib.web.a libraylib.a
|
||||
mv libraylib.a "../../${wasm_library_dest}"
|
||||
make --silent clean
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue