diff --git a/CMakeLists.txt b/CMakeLists.txt index 623753c..c42dd86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,6 +260,20 @@ if (EMSCRIPTEN) endif() set_target_properties(${OutputExecutable} PROPERTIES LINK_FLAGS "--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/emscripten_shell.html") + + add_custom_command( + TARGET ${OutputExecutable} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E remove -f ${CMAKE_BINARY_DIR}/bin/index.html + ) + + add_custom_command( + TARGET ${OutputExecutable} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E rename ${CMAKE_BINARY_DIR}/bin/${OutputExecutable}.html ${CMAKE_BINARY_DIR}/bin/index.html + ) endif() # Emscripten ###################################################################### diff --git a/emscripten_shell.html b/emscripten_shell.html new file mode 100644 index 0000000..5c4ff2c --- /dev/null +++ b/emscripten_shell.html @@ -0,0 +1,148 @@ + + + + + + Hamster + + + + +
+ +
+ + + {{{ SCRIPT }}} + + + \ No newline at end of file