Skip to content
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

[Question] build with emscripten #190

Closed
MateusDornelles opened this issue May 14, 2020 · 3 comments
Closed

[Question] build with emscripten #190

MateusDornelles opened this issue May 14, 2020 · 3 comments

Comments

@MateusDornelles
Copy link

Hi, does sdl_gpu build with emscripten out of the box, or do i need to modify the build system ? I ask because when i tried to build it with emcmake it complained about not being able to find sdl2.

@albertvaka
Copy link
Contributor

It builds out of the box, make sure you are passing the right compiler flags (eg: -s USE_SDL=2).

@grimfang4
Copy link
Owner

Is this a flag that should be added to the CMake script?

@albertvaka
Copy link
Contributor

albertvaka commented Sep 24, 2020

It's a bit more complicated than that, I've opened a PR with the needed changes to build on emscripten: #205

With those changes, the following build commands succeed:

mkdir build
cd build
emcmake cmake ..
emmake make

This should allow you to use sdl-gpu as a static library from your emscripten project, but note I haven't tested that. When I build sdl-gpu games on emscripten I copy the entire sdl-gpu project into my project and I build everything statically using the same compiler flags for all the code (sdl-gpu + my project code together). But I assume it should work as a static library as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants