summaryrefslogtreecommitdiffstats
path: root/unityplugin
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-16 20:24:15 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-16 20:24:15 +0000
commitb627a510d3ea60b4748e171d5702bedca399bfd9 (patch)
tree0eb4d5cdd09a534940a11d96eb25a32ad1784092 /unityplugin
parentMinor update to CMake; fixed compiler warning; updated DiligentCore submodule (diff)
downloadDiligentEngine-b627a510d3ea60b4748e171d5702bedca399bfd9.tar.gz
DiligentEngine-b627a510d3ea60b4748e171d5702bedca399bfd9.zip
CMake: updated Android build rules
Diffstat (limited to 'unityplugin')
-rw-r--r--unityplugin/CMakeLists.txt2
-rw-r--r--unityplugin/GhostCubePlugin/CMakeLists.txt2
-rw-r--r--unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt7
-rw-r--r--unityplugin/GhostCubeScene/CMakeLists.txt11
-rw-r--r--unityplugin/UnityEmulator/CMakeLists.txt7
5 files changed, 24 insertions, 5 deletions
diff --git a/unityplugin/CMakeLists.txt b/unityplugin/CMakeLists.txt
index bd06b94..a135df6 100644
--- a/unityplugin/CMakeLists.txt
+++ b/unityplugin/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.6)
add_subdirectory(UnityEmulator)
add_subdirectory(GhostCubeScene)
diff --git a/unityplugin/GhostCubePlugin/CMakeLists.txt b/unityplugin/GhostCubePlugin/CMakeLists.txt
index bf9d3c6..c552809 100644
--- a/unityplugin/GhostCubePlugin/CMakeLists.txt
+++ b/unityplugin/GhostCubePlugin/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.6)
add_subdirectory(PluginSource)
diff --git a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
index 7b5b5a6..1763759 100644
--- a/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
+++ b/unityplugin/GhostCubePlugin/PluginSource/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.6)
project(GhostCubePlugin CXX)
@@ -87,6 +87,11 @@ if(MSVC)
endif()
endif()
+if(PLATFORM_ANDROID)
+ target_compile_definitions(GhostCubePlugin-shared PRIVATE UNITY_ANDROID)
+ set_target_properties(GhostCubePlugin-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden
+endif()
+
set(UNITY_PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../UnityProject/Assets/Plugins)
if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS)
if(PLATFORM_WIN32)
diff --git a/unityplugin/GhostCubeScene/CMakeLists.txt b/unityplugin/GhostCubeScene/CMakeLists.txt
index ebcc3c1..df83e23 100644
--- a/unityplugin/GhostCubeScene/CMakeLists.txt
+++ b/unityplugin/GhostCubeScene/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.6)
project(GhostCubeScene CXX)
@@ -73,6 +73,11 @@ if(PLATFORM_WIN32 OR PLATFORM_UNIVERSAL_WINDOWS)
endif()
+elseif(PLATFORM_ANDROID)
+
+ list(APPEND ${SOURCE} src/Android/AndroidMain.cpp)
+ add_library(GhostCubeScene SHARED ${SOURCE} ${INCLUDE})
+
#elseif(APPLE)
#add_executable(GhostCubeScene MACOSX_BUNDLE Main.cpp)
#elseif(UNIX)
@@ -103,6 +108,10 @@ PRIVATE
UnityEmulator
TargetPlatform
)
+if(PLATFORM_ANDROID)
+ target_link_libraries(GhostCubeScene PRIVATE GhostCubePlugin-shared)
+endif()
+
set_common_target_properties(GhostCubeScene)
if(MSVC)
diff --git a/unityplugin/UnityEmulator/CMakeLists.txt b/unityplugin/UnityEmulator/CMakeLists.txt
index f44d0bf..dac8692 100644
--- a/unityplugin/UnityEmulator/CMakeLists.txt
+++ b/unityplugin/UnityEmulator/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.6)
project(UnityEmulator CXX)
@@ -131,6 +131,11 @@ endif()
if(PLATFORM_UNIVERSAL_WINDOWS)
target_link_libraries(UnityEmulator PRIVATE dxguid.lib)
+elseif(PLATFORM_ANDROID)
+ target_link_libraries(UnityEmulator PRIVATE NDKHelper GLESv3 android PUBLIC NativeAppGlue)
+ target_include_directories(UnityEmulator PRIVATE
+ ${ANDROID_NDK}/sources/android/cpufeatures
+ )
endif()
source_group("src" FILES ${SOURCE})