| Summary: | Cmake for android not work | ||
|---|---|---|---|
| Product: | SDL | Reporter: | tower120 |
| Component: | build | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus, tower120 |
| Version: | 2.0.5 | ||
| Hardware: | ARM | ||
| OS: | Android (All) | ||
This should all be fixed in revision control now, mostly by https://hg.libsdl.org/SDL/rev/a4c90708251c --ryan. |
in CMakeLists.txt you include filesystem twice (for UNIX and for ANDROID). Around 970-980 line there is no guard for android. Should be,probably, like this: --------- elseif(UNIX AND NOT APPLE) ... # Around 970-980 line : if(SDL_FILESYSTEM) if(NOT ANDROID) set(SDL_FILESYSTEM_UNIX 1) file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/unix/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES}) set(HAVE_SDL_FILESYSTEM TRUE) endif() endif() ... --------- Also, you don't link with GLES. I'm not sure about this, but for me this solve the link problem. I manually added (around line 770): --------- if(ANDROID) ... list(APPEND EXTRA_LDFLAGS "-Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit") # FIXME: Added manually list(APPEND EXTRA_LDFLAGS "-ldl", "-lGLESv1_CM", "-lGLESv2", "-llog", "-landroid") endif() --------- N.B. I see that you rise SDL_VIDEO_OPENGL_ES2 flag, but it seems that you not use it for now. When building from Android Studio (which use clang, by default) it is also necessary to add following cflags: "-Wa,-mimplicit-it=thumb", "-DGL_GLEXT_PROTOTYPES", "-DHAVE_PTHREADS"