floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.55k stars 469 forks source link

Android builds without fips? #951

Closed RusJJ closed 7 months ago

RusJJ commented 7 months ago

Is there any particular reason to use fips instead of just Android Studio? How to get it compiled? Cant really compile it even on Windows for Windows, probably im kinda Dumbo...

floooh commented 7 months ago

I didn't want to pull abominations like Gradle into the sample build process, so instead I'm calling a python script from cmake which generates the .apk (see here: https://github.com/floooh/fips/blob/master/tools/android-create-apk.py).

Android Studio is still useful for debugging (using the externally created APK), but other then that, in my eyes not having to rely on most of the Android build system mess is actually a good thing ;)

Of course this is all sokol-sample specific. The sokol headers don't depend on any specific build system details and should work just fine with the build workflow recommended by the Android team.

What errors are you seeing when trying to build for Windows?

RusJJ commented 7 months ago

What errors are you seeing when trying to build for Windows?

Probably im missing something... Do i need GLFW/SDL/any other to get it working completely? Just trying go work with sokol_main, seems like it still tries to call int main(), i've included "_app" and "_gfx"

floooh commented 7 months ago

Are you just trying to build the sokol samples, or a project of your own?

If you build something of your own, and don't need Android support right away, you could also start with a fips-less project like https://github.com/floooh/cimgui-sokol-starterkit or https://github.com/floooh/pacman.c. These use relatively simple cmake files.

RusJJ commented 7 months ago

Are you just trying to build the sokol samples, or a project of your own?

My own. Just trying to get it starting atleast. Thanks for the links. Hope i will get it soon!

UPD: Yeah, i got a window! Huge thanks! I just used a sokol.cpp example from pacman. Idk what i did wrong with the same logic but it works!