mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 09:33:49 +02:00
link hifi libs and openssl statically to gvr-interface
This commit is contained in:
parent
05cfd05e47
commit
2316cfb885
4 changed files with 34 additions and 17 deletions
|
@ -68,7 +68,7 @@ set(ANDROID_THIS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) # Directory this CMake fil
|
|||
## - "jarsigner" (part of the JDK)
|
||||
## - "zipalign" (part of the Android SDK)
|
||||
##################################################
|
||||
macro(android_create_apk name apk_directory shared_libraries jar_libraries assets data_directory)
|
||||
macro(android_create_apk name apk_directory shared_libraries static_libraries jar_libraries assets data_directory)
|
||||
if(ANDROID_APK_CREATE)
|
||||
# Construct the current package name and theme
|
||||
set(ANDROID_APK_PACKAGE "${ANDROID_APK_TOP_LEVEL_DOMAIN}.${ANDROID_APK_DOMAIN}.${ANDROID_APK_SUBDOMAIN}")
|
||||
|
@ -99,9 +99,9 @@ macro(android_create_apk name apk_directory shared_libraries jar_libraries asset
|
|||
get_filename_component(shared_library_filename ${value} NAME_WE)
|
||||
|
||||
# "shared_library_filename" is e.g. "libPLCore", but we need "PLCore"
|
||||
string(LENGTH ${shared_library_filename} shared_library_filename_length)
|
||||
math(EXPR shared_library_filename_length ${shared_library_filename_length}-3)
|
||||
string(SUBSTRING ${shared_library_filename} 3 ${shared_library_filename_length} shared_library_filename)
|
||||
string(LENGTH ${shared_library_filename} shared_library_filename_length)
|
||||
math(EXPR shared_library_filename_length ${shared_library_filename_length}-3)
|
||||
string(SUBSTRING ${shared_library_filename} 3 ${shared_library_filename_length} shared_library_filename)
|
||||
|
||||
# "shared_library_filename" is now e.g. "PLCore", this is what we want -> Add it to the list
|
||||
set(ANDROID_SHARED_LIBRARIES_TO_LOAD ${ANDROID_SHARED_LIBRARIES_TO_LOAD} ${shared_library_filename})
|
||||
|
@ -128,6 +128,14 @@ macro(android_create_apk name apk_directory shared_libraries jar_libraries asset
|
|||
)
|
||||
endforeach()
|
||||
|
||||
# Copy the used shared libraries
|
||||
foreach(value ${static_libraries})
|
||||
add_custom_command(TARGET ${ANDROID_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${value} "${apk_directory}/libs/${ARM_TARGET}"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Copy any required external jars to the libs folder
|
||||
foreach(value ${jar_libraries})
|
||||
add_custom_command(TARGET ${ANDROID_NAME}
|
||||
|
@ -135,7 +143,6 @@ macro(android_create_apk name apk_directory shared_libraries jar_libraries asset
|
|||
COMMAND ${CMAKE_COMMAND} -E copy ${value} "${apk_directory}/libs/"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
|
||||
# Create "build.xml", "default.properties", "local.properties" and "proguard.cfg" files
|
||||
add_custom_command(TARGET ${ANDROID_NAME}
|
||||
|
|
|
@ -9,14 +9,18 @@
|
|||
|
||||
macro(SETUP_HIFI_LIBRARY)
|
||||
|
||||
project(${TARGET_NAME})
|
||||
project(${TARGET_NAME})
|
||||
|
||||
# grab the implemenation and header files
|
||||
file(GLOB_RECURSE LIB_SRCS "src/*.h" "src/*.cpp")
|
||||
list(APPEND ${TARGET_NAME}_SRCS ${LIB_SRCS})
|
||||
|
||||
# create a library and set the property so it can be referenced later
|
||||
add_library(${TARGET_NAME} ${${TARGET_NAME}_SRCS} ${AUTOMTC_SRC})
|
||||
if (${${TARGET_NAME}_SHARED})
|
||||
add_library(${TARGET_NAME} SHARED ${${TARGET_NAME}_SRCS} ${AUTOMTC_SRC})
|
||||
else ()
|
||||
add_library(${TARGET_NAME} ${${TARGET_NAME}_SRCS} ${AUTOMTC_SRC})
|
||||
endif ()
|
||||
|
||||
set(QT_MODULES_TO_LINK ${ARGN})
|
||||
list(APPEND QT_MODULES_TO_LINK Core)
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
set(TARGET_NAME gvr-interface)
|
||||
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
|
||||
set(${TARGET_NAME}_SRCS
|
||||
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c
|
||||
)
|
||||
|
||||
set(${TARGET_NAME}_SHARED true)
|
||||
setup_hifi_library()
|
||||
|
||||
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
||||
|
@ -23,20 +22,31 @@ set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_DEFINITIONS "ANDROID")
|
|||
set(ANDROID_API_LEVEL 19)
|
||||
set(ARM_TARGET "armeabi-v7a")
|
||||
|
||||
set(TARGET_SHARED_LIBRARIES ${${TARGET_NAME}_LIBRARIES_TO_LINK})
|
||||
list(APPEND TARGET_SHARED_LIBRARIES "${LIBRARY_OUTPUT_PATH}/lib${TARGET_NAME}.so")
|
||||
foreach(TARGET_LINK_LIBRARY ${${TARGET_NAME}_LIBRARIES_TO_LINK})
|
||||
get_filename_component(LIB_EXTENSION ${TARGET_LINK_LIBRARY} NAME_WE)
|
||||
|
||||
if (LIB_EXTENSION STREQUAL "so")
|
||||
list(APPEND TARGET_SHARED_LIBRARIES ${TARGET_LINK_LIBRARY})
|
||||
else ()
|
||||
list(APPEND TARGET_STATIC_LIBRARIES ${TARGET_LINK_LIBRARY})
|
||||
endif ()
|
||||
|
||||
endforeach()
|
||||
|
||||
# append each of the hifi shared libraries to our list of libs to link
|
||||
foreach(HIFI_SHARED_LIBRARY ${REQUIRED_HIFI_LIBRARIES})
|
||||
list(APPEND TARGET_SHARED_LIBRARIES "${LIBRARY_OUTPUT_PATH}/lib${HIFI_SHARED_LIBRARY}.so")
|
||||
foreach(HIFI_STATIC_LIBRARY ${REQUIRED_HIFI_LIBRARIES})
|
||||
list(APPEND TARGET_STATIC_LIBRARIES "${LIBRARY_OUTPUT_PATH}/lib${HIFI_STATIC_LIBRARY}.a")
|
||||
endforeach()
|
||||
|
||||
list(APPEND TARGET_SHARED_LIBRARIES "${LIBRARY_OUTPUT_PATH}/lib${TARGET_NAME}.so")
|
||||
|
||||
set(TARGET_JAR_LIBRARIES "${QT_CMAKE_PREFIX_PATH}/../../jar/QtAndroid-bundled.jar")
|
||||
|
||||
android_create_apk(
|
||||
${TARGET_NAME}
|
||||
"${CMAKE_BINARY_DIR}/apk"
|
||||
"${TARGET_SHARED_LIBRARIES}"
|
||||
"${TARGET_STATIC_LIBRARIES}"
|
||||
"${TARGET_JAR_LIBRARIES}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/assets"
|
||||
"Data"
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include <android_native_app_glue.h>
|
||||
#include <android/log.h>
|
||||
|
||||
#include <NodeList.h>
|
||||
|
||||
// usage of log
|
||||
#define APP_NAME "Interface"
|
||||
|
||||
|
@ -37,8 +35,6 @@ void android_main(struct android_app* state) {
|
|||
|
||||
// set up so when commands happen we call our custom handler
|
||||
state->onAppCmd = custom_handle_cmd;
|
||||
|
||||
NodeList* nodeList = NodeList::createInstance(NodeType::Agent);
|
||||
|
||||
while (1) {
|
||||
struct android_poll_source* source;
|
||||
|
|
Loading…
Reference in a new issue