mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
Move Android JNI bits from DolphinWX to the Android folder.
This commit is contained in:
parent
0a42a0ab1b
commit
74478addeb
@ -559,6 +559,9 @@ endif()
|
||||
# Setup include directories (and make sure they are preferred over the Externals)
|
||||
#
|
||||
include_directories(Source/Core)
|
||||
if(ANDROID)
|
||||
include_directories(Source/Android)
|
||||
endif()
|
||||
|
||||
########################################
|
||||
# Process externals and setup their include directories
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/IniFile.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "DolphinWX/Android/ButtonManager.h"
|
||||
#include "jni/ButtonManager.h"
|
||||
|
||||
namespace ButtonManager
|
||||
{
|
||||
@ -560,6 +560,7 @@ namespace ButtonManager
|
||||
auto it = m_controllers.find(dev);
|
||||
if (it != m_controllers.end())
|
||||
return it->second->PressEvent(button, action);
|
||||
return false;
|
||||
}
|
||||
void GamepadAxisEvent(const std::string& dev, int axis, float value)
|
||||
{
|
34
Source/Android/jni/CMakeLists.txt
Normal file
34
Source/Android/jni/CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
||||
list(APPEND LIBS core uicommon)
|
||||
|
||||
set(SRCS ButtonManager.cpp
|
||||
MainAndroid.cpp)
|
||||
|
||||
if(ANDROID)
|
||||
set(DOLPHIN_EXE main)
|
||||
add_library(${DOLPHIN_EXE} SHARED ${SRCS})
|
||||
target_link_libraries(${DOLPHIN_EXE}
|
||||
log
|
||||
android
|
||||
"-Wl,--no-warn-mismatch"
|
||||
"-Wl,--whole-archive"
|
||||
${LIBS}
|
||||
"-Wl,--no-whole-archive"
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/jniLibs/${ANDROID_NDK_ABI_NAME}
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/lib${DOLPHIN_EXE}.so ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/jniLibs/${ANDROID_NDK_ABI_NAME}/
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS ${CMAKE_SOURCE_DIR}/Data/Sys/GC/* ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS -r ${CMAKE_SOURCE_DIR}/Data/Sys/Shaders ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/
|
||||
)
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE})
|
||||
endif()
|
@ -11,7 +11,7 @@
|
||||
#include <android/native_window_jni.h>
|
||||
#include <EGL/egl.h>
|
||||
|
||||
#include "Android/ButtonManager.h"
|
||||
#include "ButtonManager.h"
|
||||
|
||||
#include "Common/CommonPaths.h"
|
||||
#include "Common/CommonTypes.h"
|
@ -47,6 +47,7 @@ macro(add_dolphin_library lib srcs libs)
|
||||
endmacro(add_dolphin_library)
|
||||
|
||||
add_subdirectory(Core)
|
||||
add_subdirectory(Android/jni)
|
||||
add_subdirectory(UnitTests)
|
||||
|
||||
if (DSPTOOL)
|
||||
|
@ -73,13 +73,6 @@ endif()
|
||||
|
||||
list(APPEND LIBS core uicommon)
|
||||
|
||||
if(ANDROID)
|
||||
list(APPEND LIBS png)
|
||||
endif()
|
||||
|
||||
set(ANDROID_SRCS Android/ButtonManager.cpp
|
||||
MainAndroid.cpp)
|
||||
|
||||
if(APPLE)
|
||||
if(wxWidgets_FOUND)
|
||||
list(APPEND WXLIBS
|
||||
@ -109,35 +102,7 @@ if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE AND wxWidgets_FOUND
|
||||
GETTEXT_CREATE_TRANSLATIONS(${CMAKE_SOURCE_DIR}/Languages/po/dolphin-emu.pot ${LINGUAS})
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(DOLPHIN_EXE main)
|
||||
add_library(${DOLPHIN_EXE} SHARED ${SRCS} ${ANDROID_SRCS})
|
||||
target_link_libraries(${DOLPHIN_EXE}
|
||||
log
|
||||
android
|
||||
"-Wl,--no-warn-mismatch"
|
||||
"-Wl,--whole-archive"
|
||||
${LIBS}
|
||||
"-Wl,--no-whole-archive"
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/jniLibs/${ANDROID_NDK_ABI_NAME}
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/lib${DOLPHIN_EXE}.so ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/jniLibs/${ANDROID_NDK_ABI_NAME}/
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS ${CMAKE_SOURCE_DIR}/Data/Sys/GC/* ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS -r ${CMAKE_SOURCE_DIR}/Data/Sys/Shaders ${CMAKE_SOURCE_DIR}/Source/Android/app/src/main/assets/
|
||||
)
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE})
|
||||
elseif(wxWidgets_FOUND)
|
||||
if(wxWidgets_FOUND)
|
||||
add_executable(${DOLPHIN_EXE} ${SRCS} ${GUI_SRCS})
|
||||
target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS})
|
||||
if(APPLE)
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DolphinWX/Android/ButtonManager.h"
|
||||
#include "InputCommon/ControllerInterface/Device.h"
|
||||
#include "jni/ButtonManager.h"
|
||||
|
||||
namespace ciface
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user