Conversation
…e of the class + passing arguments as void* struct
ghost
left a comment
There was a problem hiding this comment.
I will try to see if I can get it to work, and also try to make it better! But overall great work into making this come back
| if (CROSSBUILD_EMSCRIPTEN) | ||
| # Turn off not features that are not compatible with emscripten | ||
|
|
||
| include(~/.conan/data/emsdk_installer/1.39.6/bincrafters/stable/package/1492a59deb6efdf29776a5734de63fc5f5c58650/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake ) |
There was a problem hiding this comment.
The hash is likely to change... We should use the proper conan way to do this
There was a problem hiding this comment.
You're right about both, but i don't know how to do this with conan. Maybe @AnotherFoxGuy could help us out here?
| set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --no-check-features") | ||
|
|
||
| #Debug information | ||
| #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --profiling-funcs -Oz -g4 -s PTHREAD_POOL_SIZE=8 -s DEMANGLE_SUPPORT=1 -pthread -s DISABLE_EXCEPTION_CATCHING=0 -s ASSERTIONS=1 -s USE_PTHREADS=1 -s USE_SDL_IMAGE=2 -s USE_SDL_TTF=2 -s USE_ZLIB=1" ) |
There was a problem hiding this comment.
You should probably remove this comment
| #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --profiling-funcs -Oz -g4 -s PTHREAD_POOL_SIZE=8 -s DEMANGLE_SUPPORT=1 -pthread -s DISABLE_EXCEPTION_CATCHING=0 -s ASSERTIONS=1 -s USE_PTHREADS=1 -s USE_SDL_IMAGE=2 -s USE_SDL_TTF=2 -s USE_ZLIB=1" ) |
There was a problem hiding this comment.
I left this in because those are the flags that can be used to debug emscripten. Instead of removing the command, we should check for CMAKE_BUILD_TYPE=Debug and use the aproprate flags instead.
| } | ||
|
|
||
| #else | ||
| // #else |
There was a problem hiding this comment.
I think you should remove this comment
| // #else |
| } | ||
| } | ||
|
|
||
| void gameLoop(void* arg_) |
There was a problem hiding this comment.
It's good that you were able to get it to work this way. However I don't think this is the right solution. If Emscripten truly doesn't support multithreading then we can try using coroutines instead. For now, this is a good starting point
There was a problem hiding this comment.
i was sure you wouldn't be happy with this solution. (Because i'm not too) According to the documentation:
https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop
it seems to be the only way to do this.
I think we could ifdef this?
| list(APPEND CMAKE_MODULE_PATH "${CONAN_LIB_DIRS_CATCH2}/cmake/Catch2") | ||
| endif () | ||
|
|
||
| # these compiler options are mostly for debugging and trying to get it to work |
There was a problem hiding this comment.
I think these should go in CompileOptions.cmake
|
Hey there- I'm a bot, here to let you know that some code in this PR might not Please see that Pull Request's description for more details. |
|
Kudos, SonarCloud Quality Gate passed!
|
Fixes #114
Also see #114 for build instructions. It's quite complicated :- /