hello_imgui
hello_imgui copied to clipboard
Metal backend + emscripten favicon and shell template
I ran into a couple related issues regarding emscripten.
- 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 viaconfigure_file
with cmake variables, or if I do generateshell.emscripten.html
viaconfigure_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 throughconfigure_file
; elifshell.emscripten.html
present in source tree, use that withoutconfigure_file
. - check for
shell.emscripten.html
first in the build directory, and only if not present, also check forshell.emscripten.html
in the source directory (this would allow the downstream project to configure the file before callinghello_imgui_add_app
)
- check for
- 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