hello_imgui icon indicating copy to clipboard operation
hello_imgui copied to clipboard

Metal backend + emscripten favicon and shell template

Open wkjarosz opened this issue 7 months ago • 22 comments

I ran into a couple related issues regarding emscripten.

  1. I see that i can set a custom shell file, but, unlike the built-in shell file, customizing it with CMAKE variables is awkward. The cmake scripts currently check for shell.emscripten.html in the source directory. That means the shell file can't be customize via configure_file with cmake variables, or if I do generate shell.emscripten.html via configure_file, then i am forced to pollute my source tree with a generated file. Possible solutions:
    • check for shell.emscripten.html.in in the source directory first, if present, pass it through configure_file; elif shell.emscripten.html present in source tree, use that without configure_file.
    • check for shell.emscripten.html first in the build directory, and only if not present, also check for shell.emscripten.html in the source directory (this would allow the downstream project to configure the file before calling hello_imgui_add_app)
  2. what is the right way to add additional file dependencies to the shell file? For instance, if i'd like to include an external .js script file within the shell file it would need to be copied to the build directory. so far my workaround has been to just paste the entire contents of the .js file directly in my custom shell file, but that is suboptimal: it makes the shell file very long, and the generated html file has all comments (including copyright) of the embedded code stripped.

Thanks

wkjarosz avatar Dec 05 '23 16:12 wkjarosz