script improvements
parent
4da9db876a
commit
356f88f3ba
|
@ -15,7 +15,7 @@ if(MSVC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (EMSCRIPTEN)
|
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_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_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)
|
set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)
|
||||||
|
|
|
@ -37,7 +37,7 @@ typedef struct {
|
||||||
#define DBG_GAP_HEIGHT DBG_FONT_SPACING * 0.5f
|
#define DBG_GAP_HEIGHT DBG_FONT_SPACING * 0.5f
|
||||||
|
|
||||||
static uint8_t is_shadow_rendered;
|
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 uint8_t is_handle_ctrl_held;
|
||||||
static float debug_xpos = DBG_START_XPOS;
|
static float debug_xpos = DBG_START_XPOS;
|
||||||
static float debug_ypos = DBG_START_YPOS;
|
static float debug_ypos = DBG_START_YPOS;
|
||||||
|
|
18
web/bind.sh
18
web/bind.sh
|
@ -1,20 +1,10 @@
|
||||||
#!/bin/bash
|
#!/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
|
# Symlink sources
|
||||||
if [ ! -d "build_web/${ECO2D_SERVER_URL}" ]; then
|
if [ ! -d "build_web/map" ]; then
|
||||||
mkdir -p "build_web/${ECO2D_SERVER_URL}"
|
|
||||||
pushd build_web
|
pushd build_web
|
||||||
ln -s "/workspaces/eco2d/code" "${ECO2D_SERVER_URL/build_web/}/code"
|
mkdir -p "map/build_web"
|
||||||
ln -s "/workspaces/eco2d/build_web/_deps" "${ECO2D_SERVER_URL/build_web/}build_web/_deps"
|
ln -s "/workspaces/eco2d/code" "map/code"
|
||||||
|
ln -s "/workspaces/eco2d/build_web/_deps" "map/build_web/_deps"
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
web/build.sh
|
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
cmake --build build_web --parallel
|
|
||||||
|
|
||||||
pushd build_web
|
pushd build_web
|
||||||
|
BUILD_PATH_PREFIX_MAP=$(pwd)=. cmake --build . --parallel
|
||||||
if [ -f "eco2d.html" ]; then
|
if [ -f "eco2d.html" ]; then
|
||||||
mv eco2d.html index.html
|
mv eco2d.html index.html
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
cmake --build build_web --target clean
|
|
@ -2,8 +2,4 @@
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
if [ -d "build_web" ]; then
|
|
||||||
rm -rf build_web
|
|
||||||
fi
|
|
||||||
|
|
||||||
python -m http.server --directory build_web --bind 127.0.0.1
|
python -m http.server --directory build_web --bind 127.0.0.1
|
||||||
|
|
Loading…
Reference in New Issue