cmake: don't use result of 'find_library' for Android libraries

This commit is contained in:
Anonymous Maarten 2022-07-25 23:46:36 +02:00 committed by Sam Lantinga
parent 430c39082f
commit 5c70e45c53
1 changed files with 3 additions and 9 deletions

View File

@ -1133,8 +1133,7 @@ if(ANDROID)
file(GLOB OPENSLES_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/openslES/*.c) file(GLOB OPENSLES_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/openslES/*.c)
list(APPEND SOURCE_FILES ${OPENSLES_AUDIO_SOURCES}) list(APPEND SOURCE_FILES ${OPENSLES_AUDIO_SOURCES})
find_library(ANDROID_OPENSLES_LIBRARY OpenSLES) list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} OpenSLES)
list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} ${ANDROID_OPENSLES_LIBRARY})
set(SDL_AUDIO_DRIVER_AAUDIO 1) set(SDL_AUDIO_DRIVER_AAUDIO 1)
file(GLOB AAUDIO_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/aaudio/*.c) file(GLOB AAUDIO_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/aaudio/*.c)
@ -1201,10 +1200,7 @@ if(ANDROID)
# Core stuff # Core stuff
# find_library(ANDROID_DL_LIBRARY dl) # find_library(ANDROID_DL_LIBRARY dl)
# FIXME failing dlopen https://github.com/android-ndk/ndk/issues/929 # FIXME failing dlopen https://github.com/android-ndk/ndk/issues/929
find_library(ANDROID_DL_LIBRARY NAMES libdl.so dl) list(APPEND EXTRA_LIBS dl log android)
find_library(ANDROID_LOG_LIBRARY log)
find_library(ANDROID_LIBRARY_LIBRARY android)
list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} ${ANDROID_LOG_LIBRARY} ${ANDROID_LIBRARY_LIBRARY})
target_compile_definitions(sdl-build-options INTERFACE "-DGL_GLEXT_PROTOTYPES") target_compile_definitions(sdl-build-options INTERFACE "-DGL_GLEXT_PROTOTYPES")
#enable gles #enable gles
@ -1216,9 +1212,7 @@ if(ANDROID)
set(SDL_VIDEO_OPENGL_ES2 1) set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1) set(SDL_VIDEO_RENDER_OGL_ES2 1)
find_library(OpenGLES1_LIBRARY GLESv1_CM) list(APPEND EXTRA_LIBS GLESv1_CM GLESv2)
find_library(OpenGLES2_LIBRARY GLESv2)
list(APPEND EXTRA_LIBS ${OpenGLES1_LIBRARY} ${OpenGLES2_LIBRARY})
endif() endif()
if(SDL_VULKAN) if(SDL_VULKAN)