From 26af70588daca8ca16159a49fcd795bafb1cee7d Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 16 Nov 2017 19:49:58 -0800 Subject: Fixed Android build --- unityplugin/GhostCubeScene/build/Win32/AndroidManifest.xml | 6 +++--- .../GhostCubeScene/build/Win32/GhostCubeScene.vcxproj | 3 +++ unityplugin/GhostCubeScene/build/Win32/android_build.bat | 13 +++++++++++++ unityplugin/GhostCubeScene/build/Win32/build.xml | 6 +++++- unityplugin/GhostCubeScene/build/Win32/jni/Android.mk | 9 +++++++-- unityplugin/GhostCubeScene/build/Win32/run.bat | 9 ++------- unityplugin/GhostCubeScene/src/Android/AndroidMain.cpp | 1 + 7 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 unityplugin/GhostCubeScene/build/Win32/android_build.bat (limited to 'unityplugin/GhostCubeScene') 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 @@ - + - + - + 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)" {7380f7e6-315f-4b4e-92eb-e6aeee865298} + + {22ba09ae-e0b5-49f1-8403-2a824762376e} + {664e6f0d-6784-4760-9565-d54f8eb1edf4} 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 @@ - + + + + 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 +#include #include #include "IUnityInterface.h" -- cgit v1.2.3