script improvements

isolation_bkp/dynres
Dominik Madarász 2022-09-12 06:54:59 +00:00 committed by GitHub
parent 4da9db876a
commit 356f88f3ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 12 additions and 22 deletions

View File

@ -15,7 +15,7 @@ if(MSVC)
endif()
if (EMSCRIPTEN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=$ENV{ECO2D_SERVER_URL}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g -s USE_GLFW=3 --profiling -s ASSERTIONS=1 -s WASM=1 -s INITIAL_MEMORY=268435456 -s FORCE_FILESYSTEM=1 --preload-file ${CMAKE_SOURCE_DIR}/art@art/ --shell-file ${CMAKE_SOURCE_DIR}/web/eco2d.html")
set(CMAKE_EXECUTABLE_SUFFIX ".html") # This line is used to set your executable to build with the emscripten html template so that you can directly open it.
set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)

View File

@ -37,7 +37,7 @@ typedef struct {
#define DBG_GAP_HEIGHT DBG_FONT_SPACING * 0.5f
static uint8_t is_shadow_rendered;
static uint8_t is_debug_open = 1;
static uint8_t is_debug_open = 0;
static uint8_t is_handle_ctrl_held;
static float debug_xpos = DBG_START_XPOS;
static float debug_ypos = DBG_START_YPOS;

View File

@ -1,20 +1,10 @@
#!/bin/bash
# Run as "source web/host.sh" to set up environment variables
# Prompt for URL
read -p "Enter URL: " URL
# Expose URL to environment
export ECO2D_SERVER_URL=${URL/https:\/\//}build_web
echo ${ECO2D_SERVER_URL}
# Symlink sources
if [ ! -d "build_web/${ECO2D_SERVER_URL}" ]; then
mkdir -p "build_web/${ECO2D_SERVER_URL}"
if [ ! -d "build_web/map" ]; then
pushd build_web
ln -s "/workspaces/eco2d/code" "${ECO2D_SERVER_URL/build_web/}/code"
ln -s "/workspaces/eco2d/build_web/_deps" "${ECO2D_SERVER_URL/build_web/}build_web/_deps"
mkdir -p "map/build_web"
ln -s "/workspaces/eco2d/code" "map/code"
ln -s "/workspaces/eco2d/build_web/_deps" "map/build_web/_deps"
popd
fi
web/build.sh

View File

@ -2,9 +2,8 @@
set -xe
cmake --build build_web --parallel
pushd build_web
BUILD_PATH_PREFIX_MAP=$(pwd)=. cmake --build . --parallel
if [ -f "eco2d.html" ]; then
mv eco2d.html index.html
fi

5
web/clean.sh 100755
View File

@ -0,0 +1,5 @@
#!/bin/bash
set -xe
cmake --build build_web --target clean

View File

@ -2,8 +2,4 @@
set -xe
if [ -d "build_web" ]; then
rm -rf build_web
fi
python -m http.server --directory build_web --bind 127.0.0.1