-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emscripten compilation issues #780
Comments
This page suggests a way to handle _mm_pause in WASM. https://emscripten.org/docs/porting/simd.html |
It says But anyway, the code from miniaudio that I am using is working. |
The miniaudio solution has a lot of stuff. I'll be trying to build on Emscripten soon and will investigate. |
@eduardodoria Your approach to those errors wasn't really correct. In file included from /tmp/box2d/src/contact_solver.c:482:
/home/peter/.emscripten_cache/sysroot/include/compat/emmintrin.h:11:2: error: "SSE2 instruction set not enabled"
11 | #error "SSE2 instruction set not enabled"
| ^ The issue with the intrinsics is that
elseif (EMSCRIPTEN)
message(STATUS "Box2D on Emscripten")
+ target_compile_options(box2d PRIVATE -msimd128 -msse2)
elseif (UNIX) This patch fixes that specific compiler error. The next error I see is: /tmp/box2d/src/timer.c:192:8: error: use of undeclared identifier 'size_t'; did you mean 'sizeof'?
192 | for ( size_t i = 0; i < count; i++ )
| ^~~~~~
| sizeof
/tmp/box2d/src/timer.c:192:17: error: expression is not assignable
192 | for ( size_t i = 0; i < count; i++ )
| ~~~~~~~~ ^ But this is just a normal problem with depending on a transitive include, including stddef.h in timer.c solved it for me. |
Also, for emscripten, building the samples doesn't currently work, because of
https://emscripten.org/docs/compiling/Contrib-Ports.html |
@Peter0x44 you are correct. |
This is just where the problems begin. The shaders need porting to gles2, along with some changes/removal of glad. |
I think I addressed these issues in #787. However, I haven't tested Emscripten with this yet. |
I'm getting this error when compiling with Emscripten:
Tried to add this to CMakeLists.txt:
And I got this error:
So, I modified
solver.c
with code similar to miniaudio lib:Instead of:
I changed to:
And works now!
The text was updated successfully, but these errors were encountered: