summaryrefslogtreecommitdiffstats
path: root/Platforms
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-16 05:23:06 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-16 05:23:06 +0000
commit035dd284b70429c7a59237c1e6debc1663bd7e15 (patch)
treeb2d50e6c0141bfb8c403010831036799ac657411 /Platforms
parentUpdated CMakeLists (diff)
downloadDiligentCore-035dd284b70429c7a59237c1e6debc1663bd7e15.tar.gz
DiligentCore-035dd284b70429c7a59237c1e6debc1663bd7e15.zip
CMake: enabling Android build
Diffstat (limited to 'Platforms')
-rw-r--r--Platforms/Android/CMakeLists.txt41
-rw-r--r--Platforms/Basic/CMakeLists.txt2
-rw-r--r--Platforms/CMakeLists.txt2
-rw-r--r--Platforms/interface/PlatformDefinitions.h10
4 files changed, 49 insertions, 6 deletions
diff --git a/Platforms/Android/CMakeLists.txt b/Platforms/Android/CMakeLists.txt
new file mode 100644
index 00000000..0dcfc55b
--- /dev/null
+++ b/Platforms/Android/CMakeLists.txt
@@ -0,0 +1,41 @@
+cmake_minimum_required (VERSION 3.6)
+
+project(AndroidPlatform CXX)
+
+set(INCLUDE
+ include/AndroidDebug.h
+ include/AndroidFileSystem.h
+ include/AndroidPlatformDefinitions.h
+ include/AndroidPlatformMisc.h
+)
+
+set(SOURCE
+ src/AndroidDebug.cpp
+ src/AndroidFileSystem.cpp
+)
+
+add_library(AndroidPlatform ${SOURCE} ${INCLUDE})
+set_common_target_properties(AndroidPlatform)
+
+target_include_directories(AndroidPlatform
+PUBLIC
+ include
+)
+
+target_link_libraries(AndroidPlatform
+PRIVATE
+ BuildSettings
+ Common
+ NdkHelper
+ log
+PUBLIC
+ PlatformInterface
+ BasicPlatform
+)
+
+source_group("src" FILES ${SOURCE})
+source_group("include" FILES ${INCLUDE})
+
+set_target_properties(AndroidPlatform PROPERTIES
+ FOLDER Core/Platforms
+)
diff --git a/Platforms/Basic/CMakeLists.txt b/Platforms/Basic/CMakeLists.txt
index 657b4932..1a08f952 100644
--- a/Platforms/Basic/CMakeLists.txt
+++ b/Platforms/Basic/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.6)
project(BasicPlatform CXX)
diff --git a/Platforms/CMakeLists.txt b/Platforms/CMakeLists.txt
index 465e37de..77fa5ce6 100644
--- a/Platforms/CMakeLists.txt
+++ b/Platforms/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.8)
+cmake_minimum_required (VERSION 3.6)
add_library(PlatformInterface INTERFACE)
diff --git a/Platforms/interface/PlatformDefinitions.h b/Platforms/interface/PlatformDefinitions.h
index 6289a655..69fe10c1 100644
--- a/Platforms/interface/PlatformDefinitions.h
+++ b/Platforms/interface/PlatformDefinitions.h
@@ -24,10 +24,12 @@
#pragma once
#if defined(ANDROID)
- #if defined (PLATFORM_UNIVERSAL_WINDOWS) || defined (PLATFORM_WIN32)
- #error Conflicting platform macros
- #endif
- #define PLATFORM_ANDROID
+# if defined (PLATFORM_UNIVERSAL_WINDOWS) || defined (PLATFORM_WIN32)
+# error Conflicting platform macros
+# endif
+# ifndef PLATFORM_ANDROID
+# define PLATFORM_ANDROID
+# endif
#elif !defined (PLATFORM_UNIVERSAL_WINDOWS) && !defined (PLATFORM_WIN32)
#error Platform is not defined
#endif