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

Cmake for android not work #2322

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Cmake for android not work #2322

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.5
Reported for operating system, platform: Android (All), ARM

Comments on the original bug report:

On 2016-12-07 19:59:43 +0000, wrote:

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"

On 2017-06-06 17:45:57 +0000, Ryan C. Gordon wrote:

This should all be fixed in revision control now, mostly by

https://hg.libsdl.org/SDL/rev/a4c90708251c

--ryan.

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

1 participant