Skip to content

Commit

Permalink
Emscripten web app cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhues committed Jan 29, 2024
1 parent 8a2d96f commit a2488cc
Show file tree
Hide file tree
Showing 7 changed files with 2,550 additions and 110 deletions.
9 changes: 9 additions & 0 deletions AddBundle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,17 @@ function(ae_add_bundle)
list(APPEND _AE_EM_LINKER_FLAGS
"--closure=1" # Enable Closure compiler for aggressive JS size minification
"-O3"
# "-Wl,-u,htonl" # Workaround for -flto issue
# "-flto"
# "-fno-exceptions"
)
# list(APPEND _AE_EM_COMPILER_FLAGS
# "-flto"
# "-fno-exceptions"
# )
endif()
string (REPLACE ";" " " _AE_EM_LINKER_FLAGS "${_AE_EM_LINKER_FLAGS}")
string (REPLACE ";" " " _AE_EM_COMPILER_FLAGS "${_AE_EM_COMPILER_FLAGS}")

set_target_properties(${ADD_BUNDLE_EXECUTABLE_NAME} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${ADD_BUNDLE_EXECUTABLE_NAME}"
Expand All @@ -208,6 +216,7 @@ function(ae_add_bundle)

set_target_properties(${ADD_BUNDLE_EXECUTABLE_NAME} PROPERTIES
LINK_FLAGS "${_AE_EM_LINKER_FLAGS}"
COMPILE_FLAGS "${_AE_EM_COMPILER_FLAGS}"
OUTPUT_NAME "index"
SUFFIX ${_AE_EM_OUT_SUFFIX}
)
Expand Down
2,643 changes: 2,537 additions & 106 deletions docs/examples/22_read_me/index.js

Large diffs are not rendered by default.

Binary file modified docs/examples/22_read_me/index.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/examples/22_read_me/index.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"display": "fullscreen",
"icons": [
{
"src": "https://raw.githubusercontent.com/johnhues/aether-game-utils/master/examples/data/Icon.png",
"src": "https://raw.githubusercontent.com/johnhues/aether-game-utils/master/examples/data/WebIcon.png",
"type": "image/png",
"sizes": "512x512"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(EMSCRIPTEN)
add_compile_definitions(DATA_DIR="https://raw.githubusercontent.com/johnhues/aether-game-utils/master/examples/data")
endif()
if(EMSCRIPTEN)
set(AE_EXAMPLE_RESOURCES "index.html;index.webmanifest;data/Icon.png")
set(AE_EXAMPLE_RESOURCES "index.html;index.webmanifest;data/WebIcon.png")
elseif(APPLE)
set(AE_EXAMPLE_RESOURCES "data/Icon.icns")
endif()
Expand Down
Binary file added examples/data/WebIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/index.webmanifest
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Example",
"start_url": "http://localhost:8000/examples",
"start_url": "http://localhost:8000/em/examples",
"display": "fullscreen",
"icons": [
{
"src": "http://localhost:8000/examples/data/Icon.png",
"src": "http://localhost:8000/examples/data/WebIcon.png",
"type": "image/png",
"sizes": "512x512"
}
Expand Down

0 comments on commit a2488cc

Please sign in to comment.