From 035dd284b70429c7a59237c1e6debc1663bd7e15 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 15 Dec 2017 21:23:06 -0800 Subject: CMake: enabling Android build --- Platforms/Android/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++ Platforms/Basic/CMakeLists.txt | 2 +- Platforms/CMakeLists.txt | 2 +- Platforms/interface/PlatformDefinitions.h | 10 +++++--- 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 Platforms/Android/CMakeLists.txt (limited to 'Platforms') 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 -- cgit v1.2.3