Files
UnrealEngineUWP/Engine/Source/ThirdParty/CMake/PlatformScripts/Android/Android.cmake
devin doucette 0d0880c989 Extended and added platforms to UAT BuildCMakeLib
- Wrapped the build in try/finally to always clean up of the build directory.
- Fixed target platform construction to include the target architecture.
- Fixed target platform construction to log an error on failure instead of crashing on a null dereference later.
- Fixed configuration name comparisons to be case-insensitive.
- Added an optional BinOutputPath param to match LibOutputPath.
- Changed to an empty default MakeTarget because CMake was not generating a target with the previous default name.
- Changed BuildTargetLib to use cmake --build instead of implementing custom build logic for every target platform.
- Changed Linux to use CMake and make from the path instead of attempting to use the Mac binaries.
- Simplified the TargetPlatform interface to remove a lot of boilerplate code from the implementations.

#jira none
#rb Brandon.Schaefer

[CL 14439522 by devin doucette in ue5-main branch]
2020-10-07 13:32:27 -04:00

56 lines
1.6 KiB
CMake

# Copyright Epic Games, Inc. All Rights Reserved.
set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 21)
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE)
if(NOT DEFINED ENV{ANDROID_NDK_ROOT})
message(FATAL_ERROR "ANDROID_NDK_ROOT environment variable is not set!")
endif()
file(TO_CMAKE_PATH $ENV{ANDROID_NDK_ROOT} CMAKE_ANDROID_NDK)
if(NOT EXISTS ${CMAKE_ANDROID_NDK})
message(FATAL_ERROR "ANDROID_NDK_ROOT environment variable must point to the NDK directory!")
endif()
if(NOT EXISTS "${CMAKE_ANDROID_NDK}/platforms/android-${CMAKE_SYSTEM_VERSION}")
message(FATAL_ERROR "Android NDK at ${CMAKE_ANDROID_NDK} does not contain API ${CMAKE_SYSTEM_VERSION}!")
endif()
string(CONCAT UE_FLAGS
" -fPIC"
" -fno-short-enums"
" -fno-strict-aliasing"
" -fstack-protector-strong"
" -funwind-tables"
" -g2"
" -gdwarf-4"
" -no-canonical-prefixes"
)
string(CONCAT UE_FLAGS_C
)
string(CONCAT UE_FLAGS_CXX
" -std=c++14"
)
string(CONCAT UE_FLAGS_DEBUG
" -O0"
" -D_DEBUG"
" -DDEBUG"
)
string(CONCAT UE_FLAGS_RELEASE
" -O3"
" -DNDEBUG"
)
set(CMAKE_C_FLAGS "${UE_FLAGS} ${UE_FLAGS_C}" CACHE STRING "C Flags" FORCE)
set(CMAKE_CXX_FLAGS "${UE_FLAGS} ${UE_FLAGS_CXX}" CACHE STRING "C++ Flags" FORCE)
set(CMAKE_C_FLAGS_DEBUG "${UE_FLAGS_DEBUG}" CACHE STRING "C Debug Flags" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "${UE_FLAGS_DEBUG}" CACHE STRING "C++ Debug Flags" FORCE)
set(CMAKE_C_FLAGS_RELEASE "${UE_FLAGS_RELEASE}" CACHE STRING "C Release Flags" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "${UE_FLAGS_RELEASE}" CACHE STRING "C++ Release Flags" FORCE)