build: Support building libretro core for Android

This commit is contained in:
Connor McLaughlin 2020-07-07 20:27:06 +10:00
parent c242d4707f
commit 01287cb7da
4 changed files with 10 additions and 4 deletions

View File

@ -50,7 +50,7 @@ if(BUILD_LIBRETRO_CORE)
if(USE_X11)
set(USE_X11 OFF)
endif()
if(USE_EGL)
if(BUILD_LIBRETRO_CORE AND USE_EGL)
set(USE_EGL OFF)
endif()
@ -187,6 +187,6 @@ enable_testing()
add_subdirectory(dep)
add_subdirectory(src)
if(ANDROID)
if(ANDROID AND NOT BUILD_LIBRETRO_CORE)
add_subdirectory(android/app/src/cpp)
endif()

View File

@ -141,7 +141,7 @@ if(USE_EGL)
gl/context_egl_x11.h
)
endif()
if(ANDROID)
if(ANDROID AND USE_EGL)
target_sources(common PRIVATE
gl/context_egl_android.cpp
gl/context_egl_android.h

View File

@ -75,8 +75,10 @@ std::unique_ptr<GL::Context> Context::Create(const WindowInfo& wi, const Version
#elif defined(__APPLE__)
context = ContextAGL::Create(wi, versions_to_try, num_versions_to_try);
#elif defined(ANDROID)
#ifdef USE_EGL
context = ContextEGLAndroid::Create(wi, versions_to_try, num_versions_to_try);
#else
#endif
#elif defined(USE_X11)
if (wi.type == WindowInfo::Type::X11)
{
#ifdef USE_EGL

View File

@ -30,3 +30,7 @@ set_target_properties(duckstation_libretro PROPERTIES PREFIX "")
set_target_properties(duckstation_libretro PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set_target_properties(duckstation_libretro PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
# for android, suffix _android
if(ANDROID)
set_target_properties(duckstation_libretro PROPERTIES OUTPUT_NAME "duckstation_libretro_android")
endif()