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

Building for android #127

Open
robclouth opened this issue May 24, 2016 · 7 comments
Open

Building for android #127

robclouth opened this issue May 24, 2016 · 7 comments

Comments

@robclouth
Copy link

Hello,
I've struggled for 2 days now trying to build this for Android. I've managed to build the static libs, but linking them to the project is a bloody nightmare. Undefined variables all over the place. Does anyone have any source code I can browse to find the solution?

Thanks

@robclouth
Copy link
Author

It seems that the std library in the ndk doesn't include some key functions like rand that the library uses. Has anyone managed to get this running on Android? I might end up having to use the emscriptened js version soon...

@aliasaila
Copy link

Here's the config I used (with NDK 10e).

It's been a while but I vaguely recall modifying/deleting some of the source files as well.

In the end, it did run on Android, yes.

@robclouth
Copy link
Author

Thanks a billion, you're a life saver.

On Tue, May 24, 2016 at 4:47 PM, aliasaila notifications@github.com wrote:

Here's the config
https://gist.github.com/aliasaila/b5b041d3add88d4a4747c230f30e4eb4 I
used (with NDK 10e).

It's been a while but I vaguely recall modifying/deleting some of the
source files as well.

In the end, it did run on Android, yes.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#127 (comment)

@robclouth
Copy link
Author

Ah ok, so you're actually building it in the Android.mk. I've been building it as a static lib with cmake then just wrapping it in the Android.mk.

@robclouth
Copy link
Author

Ok got it! I wasted all that time trying to build it as a library first then wrap it, when I could have just built it directly with the Android.mk. Thanks!

@robclouth
Copy link
Author

One thing for future android builders: this version of glsl-optimizer crashes when using the release build. You have to use this fork, which has some bug fixes that aren't in this repo.

@kkirby
Copy link

kkirby commented Apr 27, 2017

I think cmake was updated to work directly with the android NDK. So now you just do:

cmake . -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="$NDK" -DCMAKE_ANDROID_ARCH_ABI=$ARCH -DCMAKE_SYSTEM_VERSION=21
make glsl_optimizer

Also, I had a similar issue with rand and what not. The issue I had was that the code I was linking against was compiling against platform-19 and glsl-optimizer was compiled for platform-21, which ins't compatible with 19. So I changed my codebase to compile against platform-21 and everything was fine.

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