Add polyvox, fix task copy bugs

This commit is contained in:
Bradley Austin Davis 2017-11-24 15:12:29 -08:00 committed by Brad Davis
parent d6072f2bf2
commit ddc2548c53
6 changed files with 70 additions and 4 deletions

View file

@ -12,9 +12,10 @@ target_link_libraries(native-lib "${HIFI_ANDROID_PRECOMPILED}/jni/arm64-v8a/libg
# networking -> openssl, tbb
# fbx -> draco
# physics -> bullet
# entities-renderer -> polyvox
# unfinished libraries
# image -> nvtt (doesn't look good, but can be made optional)
# script-engine -> quazip (probably not required for the android client)
# entities-renderer -> polyvox

View file

@ -41,6 +41,9 @@ setupDependencies.dependsOn setupDraco
apply from: 'setupBullet.gradle'
setupDependencies.dependsOn setupBullet
apply from: 'setupPolyvox.gradle'
setupDependencies.dependsOn setupPolyvox
task copyDependencies(type: Copy) {
from HIFI_ANDROID_PRECOMPILED + '/jni/arm64-v8a'
into 'app/src/main/jniLibs/arm64-v8a'

View file

@ -0,0 +1,38 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'de.undercouch:gradle-download-task:3.3.0'
}
}
def file='polyvox_armv8-libcpp.tgz'
def url='https://hifi-public.s3.amazonaws.com/austin/android/' + file
def destFile = new File(HIFI_ANDROID_PRECOMPILED, file)
task downloadPolyvox(type: de.undercouch.gradle.tasks.download.Download) {
src url
dest destFile
}
task extractPolyvox(dependsOn: downloadPolyvox, type: Copy) {
from tarTree(resources.gzip(destFile))
into new File(HIFI_ANDROID_PRECOMPILED, 'polyvox')
}
task copyPolyvoxCore(dependsOn: extractPolyvox, type: Copy) {
from HIFI_ANDROID_PRECOMPILED + '/polyvox/lib/Release'
include 'libPolyVoxCore.so'
into HIFI_ANDROID_PRECOMPILED + '/jni/arm64-v8a'
}
task copyPolyvoxUtil(dependsOn: extractPolyvox, type: Copy) {
from HIFI_ANDROID_PRECOMPILED + '/polyvox/lib'
include 'libPolyVoxUtil.so'
into HIFI_ANDROID_PRECOMPILED + '/jni/arm64-v8a'
}
task setupPolyvox(dependsOn: [copyPolyvoxCore, copyPolyvoxUtil]) { }

View file

@ -33,13 +33,13 @@ task extractQt(dependsOn: downloadQt, type: Copy) {
}
task copyQtJars(dependsOn: extractQt, type: Copy) {
from 'build/qt/jar'
from HIFI_ANDROID_PRECOMPILED + '/qt/jar'
include '*.jar'
into HIFI_ANDROID_PRECOMPILED + '/jar'
}
task copyQtLibs(dependsOn: extractQt, type: Copy) {
from 'build/qt/lib'
from HIFI_ANDROID_PRECOMPILED + '/qt/lib'
include 'libQt5AndroidExtras.so'
include 'libQt5Concurrent.so'
include 'libQt5Core.so'

View file

@ -24,7 +24,7 @@ task extractTBB(dependsOn: downloadTBB, type: Copy) {
}
task setupTBB(dependsOn: extractTBB, type: Copy) {
from 'build/tbb/lib/release'
from HIFI_ANDROID_PRECOMPILED + '/tbb/lib/release'
include 'libtbb.so'
include 'libtbbmalloc.so'
into HIFI_ANDROID_PRECOMPILED + '/jni/arm64-v8a/'

View file

@ -0,0 +1,24 @@
#
# Copyright 2015 High Fidelity, Inc.
# Created by Bradley Austin Davis on 2015/10/10
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
macro(TARGET_POLYVOX)
if (ANDROID)
set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/polyvox)
set(POLYVOX_INCLUDE_DIRS "${INSTALL_DIR}/include" CACHE TYPE INTERNAL)
set(LIB_DIR ${INSTALL_DIR}/lib)
list(APPEND POLYVOX_LIBRARIES ${LIB_DIR}/libPolyVoxUtil.so)
list(APPEND POLYVOX_LIBRARIES ${LIB_DIR}/Release/libPolyVoxCore.so)
else()
add_dependency_external_projects(polyvox)
find_package(PolyVox REQUIRED)
endif()
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${POLYVOX_INCLUDE_DIRS})
target_link_libraries(${TARGET_NAME} ${POLYVOX_LIBRARIES})
endmacro()