Skip to content

Commit

Permalink
Move Android JNI bits from DolphinWX to the Android folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonicadvance1 committed Jan 6, 2016
1 parent 0a42a0a commit 74478ad
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 39 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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)
{
Expand Down
File renamed without changes.
34 changes: 34 additions & 0 deletions Source/Android/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
37 changes: 1 addition & 36 deletions Source/Core/DolphinWX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#pragma once

#include "DolphinWX/Android/ButtonManager.h"
#include "InputCommon/ControllerInterface/Device.h"
#include "jni/ButtonManager.h"

namespace ciface
{
Expand Down

0 comments on commit 74478ad

Please sign in to comment.