summaryrefslogtreecommitdiffstats
path: root/unityplugin/GhostCubeScene
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-11-17 03:49:58 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-11-17 03:49:58 +0000
commit26af70588daca8ca16159a49fcd795bafb1cee7d (patch)
treecdae3700a42e6146df2640f574660f6fd1f89acc /unityplugin/GhostCubeScene
parentUpdated submodule (diff)
downloadDiligentEngine-26af70588daca8ca16159a49fcd795bafb1cee7d.tar.gz
DiligentEngine-26af70588daca8ca16159a49fcd795bafb1cee7d.zip
Fixed Android build
Diffstat (limited to 'unityplugin/GhostCubeScene')
-rw-r--r--unityplugin/GhostCubeScene/build/Win32/AndroidManifest.xml6
-rw-r--r--unityplugin/GhostCubeScene/build/Win32/GhostCubeScene.vcxproj3
-rw-r--r--unityplugin/GhostCubeScene/build/Win32/android_build.bat13
-rw-r--r--unityplugin/GhostCubeScene/build/Win32/build.xml6
-rw-r--r--unityplugin/GhostCubeScene/build/Win32/jni/Android.mk9
-rw-r--r--unityplugin/GhostCubeScene/build/Win32/run.bat9
-rw-r--r--unityplugin/GhostCubeScene/src/Android/AndroidMain.cpp1
7 files changed, 34 insertions, 13 deletions
diff --git a/unityplugin/GhostCubeScene/build/Win32/AndroidManifest.xml b/unityplugin/GhostCubeScene/build/Win32/AndroidManifest.xml
index e6a7d0f..f5f99f3 100644
--- a/unityplugin/GhostCubeScene/build/Win32/AndroidManifest.xml
+++ b/unityplugin/GhostCubeScene/build/Win32/AndroidManifest.xml
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.DiligentGrpahics.UnityEmulator" android:versionCode="1" android:versionName="1.0">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.DiligentGraphics.UnityEmulator" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
<uses-feature android:glEsVersion="0x00030000" android:required="true">
</uses-feature>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE">
</uses-permission>
- <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" android:hasCode="true" android:name="com.DiligentGrpahics.UnityEmulator.UnityEmulatorApplication" android:debuggable="true">
+ <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" android:hasCode="true" android:name="com.DiligentGraphics.UnityEmulator.UnityEmulatorApplication" android:debuggable="true">
<!-- Our activity is the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
- <activity android:name="com.DiligentGrpahics.UnityEmulator.UnityEmulatorNativeActivity" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden">
+ <activity android:name="com.DiligentGraphics.UnityEmulator.UnityEmulatorNativeActivity" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden">
<!-- Tell NativeActivity the name of or .so -->
<meta-data android:name="android.app.lib_name" android:value="GhostCubeSceneEmulator" />
<intent-filter>
diff --git a/unityplugin/GhostCubeScene/build/Win32/GhostCubeScene.vcxproj b/unityplugin/GhostCubeScene/build/Win32/GhostCubeScene.vcxproj
index 68dc552..aa7ad7d 100644
--- a/unityplugin/GhostCubeScene/build/Win32/GhostCubeScene.vcxproj
+++ b/unityplugin/GhostCubeScene/build/Win32/GhostCubeScene.vcxproj
@@ -228,6 +228,9 @@ copy "%(RelativeDir)%(Filename).pdb" "$(TargetDir)"</Command>
<ProjectReference Include="..\..\..\..\diligentcore\Common\build\Win32\Common.vcxproj">
<Project>{7380f7e6-315f-4b4e-92eb-e6aeee865298}</Project>
</ProjectReference>
+ <ProjectReference Include="..\..\..\..\diligentcore\External\Android\ndk_helper\build\NdkHelper.vcxproj">
+ <Project>{22ba09ae-e0b5-49f1-8403-2a824762376e}</Project>
+ </ProjectReference>
<ProjectReference Include="..\..\..\..\diligentcore\External\glew\build\Win32\glew_static.vcxproj">
<Project>{664e6f0d-6784-4760-9565-d54f8eb1edf4}</Project>
</ProjectReference>
diff --git a/unityplugin/GhostCubeScene/build/Win32/android_build.bat b/unityplugin/GhostCubeScene/build/Win32/android_build.bat
new file mode 100644
index 0000000..444e545
--- /dev/null
+++ b/unityplugin/GhostCubeScene/build/Win32/android_build.bat
@@ -0,0 +1,13 @@
+@echo off
+SET LOCAL_PATH=%~dp0
+
+SET ENGINE_ROOT=%LOCAL_PATH%/../../../..
+chdir /d "%ENGINE_ROOT%/build/Android"
+call build_all.bat
+
+chdir /d %LOCAL_PATH%
+
+call android update project -p . --target android-19
+call ant debug
+call adb install -r ./bin/UnityEmulatorNativeActivity-debug.apk
+call adb shell am start -a android.intent.action.MAIN -n com.DiligentGraphics.UnityEmulator/com.DiligentGraphics.UnityEmulator.UnityEmulatorNativeActivity
diff --git a/unityplugin/GhostCubeScene/build/Win32/build.xml b/unityplugin/GhostCubeScene/build/Win32/build.xml
index b2dcec5..d45250f 100644
--- a/unityplugin/GhostCubeScene/build/Win32/build.xml
+++ b/unityplugin/GhostCubeScene/build/Win32/build.xml
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="UnityEmulatorNativeActivity" default="help">
- <!-- The local.properties file is created and updated by the 'android' tool.
+ <!-- compilation options -->
+ <property name="java.target" value="1.7" />
+ <property name="java.source" value="1.7" />
+
+ <!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
diff --git a/unityplugin/GhostCubeScene/build/Win32/jni/Android.mk b/unityplugin/GhostCubeScene/build/Win32/jni/Android.mk
index f3ec778..47e4822 100644
--- a/unityplugin/GhostCubeScene/build/Win32/jni/Android.mk
+++ b/unityplugin/GhostCubeScene/build/Win32/jni/Android.mk
@@ -14,7 +14,7 @@ LOCAL_LDLIBS := -lGLESv3 -lEGL -llog -landroid
# methods/functions required to resolve CURRENTLY OUTSTANDING dependencies and ignores the rest.
# If a subsequent library then uses methods/functions that were not originally required by the objects, you will
# have missing dependencies.
-LOCAL_STATIC_LIBRARIES := UnityEmulator-prebuilt GraphicsEngine-prebuilt GraphicsTools-prebuilt cpufeatures android_native_app_glue ndk_helper
+LOCAL_STATIC_LIBRARIES := UnityEmulator-prebuilt GraphicsEngine-prebuilt GraphicsTools-prebuilt cpufeatures android_native_app_glue NdkHelper-prebuilt
# These libraries depend on each other
LOCAL_WHOLE_STATIC_LIBRARIES := AndroidPlatform-prebuilt BasicPlatform-prebuilt Common-prebuilt
LOCAL_SHARED_LIBRARIES := GhostCubePlugin-prebuilt GraphicsEngineOpenGL-prebuilt
@@ -110,8 +110,13 @@ LOCAL_MODULE := GhostCubePlugin-prebuilt
LOCAL_SRC_FILES := $(PROJECT_ROOT)/../GhostCubePlugin/PluginSource/build/Win32/libs/$(TARGET_ARCH_ABI)/libGhostCubePlugin.so
include $(PREBUILT_SHARED_LIBRARY)
+include $(CLEAR_VARS)
+LOCAL_MODULE := NdkHelper-prebuilt
+LOCAL_SRC_FILES := $(CORE_ROOT)/External/Android/ndk_helper/build/obj/local/$(TARGET_ARCH_ABI)/libNdkHelper.a
+LOCAL_EXPORT_C_INCLUDES := $(CORE_ROOT)/External/Android/ndk_helper/include
+include $(PREBUILT_STATIC_LIBRARY)
+
-$(call import-module,android/ndk_helper)
$(call import-module,android/native_app_glue)
$(call import-module,android/cpufeatures)
diff --git a/unityplugin/GhostCubeScene/build/Win32/run.bat b/unityplugin/GhostCubeScene/build/Win32/run.bat
index 043e72e..1b67bc1 100644
--- a/unityplugin/GhostCubeScene/build/Win32/run.bat
+++ b/unityplugin/GhostCubeScene/build/Win32/run.bat
@@ -1,11 +1,6 @@
@echo off
-cd ..\.
-SET SAMPLE_PATH="..\..\..\..\build\Win32\bin\%~1\GhostCubeScene\GhostCubeScene.exe"
-
-if not exist %SAMPLE_PATH% (
- rem echo Executable not found in the diligentsamples\build\Win32 directory. Checking parent directory.
- SET SAMPLE_PATH="..\"%SAMPLE_PATH%
-)
+cd ..\assets
+SET SAMPLE_PATH="..\..\..\build\Win32\bin\%~1\GhostCubeScene\GhostCubeScene.exe"
if not exist %SAMPLE_PATH% (
echo Executable not found. Please build the solution for the selected configuration.
diff --git a/unityplugin/GhostCubeScene/src/Android/AndroidMain.cpp b/unityplugin/GhostCubeScene/src/Android/AndroidMain.cpp
index e2e659c..6a8f541 100644
--- a/unityplugin/GhostCubeScene/src/Android/AndroidMain.cpp
+++ b/unityplugin/GhostCubeScene/src/Android/AndroidMain.cpp
@@ -23,6 +23,7 @@
// This header must be included, otherwise the linker will somehow fail to find android_main()
#include <unordered_map>
+#include <string>
#include <android_native_app_glue.h>
#include "IUnityInterface.h"