Skip to content

Commit

Permalink
[Android] Fix PCH build. Clean up DolphinWX cmake file a little bit. …
Browse files Browse the repository at this point in the history
…Modify our android cmake toolchain file to make the default build location not be source root, because that is stupid.
  • Loading branch information
Sonicadvance1 committed Oct 29, 2013
1 parent 2e98307 commit 58d42f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Source/Android/android.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
# libraries. Automatically turned for NDK r5x and r6x due to GLESv2
# problems.
#
# LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_SOURCE_DIR} - where to output binary
# LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_CURRENT_BINARY_DIR} - where to output binary
# files. See additional details below.
#
# ANDROID_SET_OBSOLETE_VARIABLES=ON - if set, then toolchain defines some
Expand Down Expand Up @@ -187,7 +187,7 @@
#
# LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where Android
# libraries will be installed.
# Default is ${CMAKE_SOURCE_DIR}, and the android libs will always be
# Default is ${CMAKE_CURRENT_BINARY_DIR}, and the android libs will always be
# under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
# (depending on the target ABI). This is convenient for Android packaging.
#
Expand Down Expand Up @@ -1431,7 +1431,7 @@ include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_STL_INCLU
link_directories( "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" )

# setup output directories
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )

if(NOT _CMAKE_IN_TRY_COMPILE)
Expand Down
6 changes: 5 additions & 1 deletion Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ set(CMAKE_FAKELANG_CREATE_STATIC_LIBRARY "touch <TARGET>")
if(ENABLE_PCH)
# This is actually a .h file, but trick cmake into compiling it as a source file
set(pch_out_filename "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/pch.dir/pch.h")
set(pch_lib_filename "${CMAKE_CURRENT_BINARY_DIR}/libpch.a")
if (ANDROID)
set(pch_lib_filename "${LIBRARY_OUTPUT_PATH}/libpch.a")
else()
set(pch_lib_filename "${CMAKE_CURRENT_BINARY_DIR}/libpch.a")
endif()
set(pch_src_filename "${CMAKE_CURRENT_SOURCE_DIR}/pch.h")

if(APPLE)
Expand Down
16 changes: 2 additions & 14 deletions Source/Core/DolphinWX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,23 +191,11 @@ if(ANDROID)
${LIBS}
"-Wl,--no-whole-archive"
)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
set (SO_TARGET "mips")
endif()
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7-a")
set (SO_TARGET "armeabi-v7a")
endif()
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv5te")
set (SO_TARGET "armeabi")
endif()
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "i686")
set (SO_TARGET "x86")
endif()
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/Source/Android/libs/${SO_TARGET}
COMMAND mkdir ARGS -p ${CMAKE_SOURCE_DIR}/Source/Android/libs/${ANDROID_NDK_ABI_NAME}
)
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
COMMAND cp ARGS ${CMAKE_SOURCE_DIR}/libs/${SO_TARGET}/lib${DOLPHIN_EXE}.so ${CMAKE_SOURCE_DIR}/Source/Android/libs/${SO_TARGET}/
COMMAND cp ARGS ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}/lib${DOLPHIN_EXE}.so ${CMAKE_SOURCE_DIR}/Source/Android/libs/${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/assets/
Expand Down

0 comments on commit 58d42f4

Please sign in to comment.