Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,81 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
include(cmake/Platform/Common/Configurations_common.cmake)
include(cmake/Platform/Common/Clang/Configurations_clang.cmake)
ly_append_configurations_options(
DEFINES
LINUX64
__ARM_NEON__
_LINUX
LINUX
ANDROID
MOBILE
_HAS_C9X
ENABLE_TYPE_INFO
__ANDROID_API__=${LY_TOOLCHAIN_NDK_API_LEVEL}
NDK_REV_MAJOR=${LY_TOOLCHAIN_NDK_PKG_MAJOR}
NDK_REV_MINOR=${LY_TOOLCHAIN_NDK_PKG_MINOR}
COMPILATION
-femulated-tls # All accesses to TLS variables are converted to calls to __emutls_get_address in the runtime library
-ffast-math # Allow aggressive, lossy floating-point optimizations,
-fno-aligned-allocation # Disable use of C++17 aligned_alloc for operator new/delete
COMPILATION_DEBUG
-gdwarf-2 # DWARF 2 debugging information
COMPILATION_PROFILE
-g # debugging information
-gdwarf-2 # DWARF 2 debugging information
LINK_NON_STATIC
-rdynamic # add ALL symbols to the dynamic symbol table
-Wl,--no-undefined # tell the gcc linker to fail if it finds undefined references
-Wl,--gc-sections # discards unused sections
-landroid # Android Library
-llog # log library for android
-lc++_shared
-ldl # Dynamic
-stdlib=libc++
-u ANativeActivity_onCreate
-L${LY_NDK_ABI_ROOT}/usr/lib
-L${LY_NDK_SRC_ROOT}/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}
LINK_NON_STATIC_DEBUG
-Wl,--build-id # Android Studio needs the libraries to have an id in order to match them with what"s running on the device.
-shared
LINK_NON_STATIC_PROFILE
-Wl,--build-id # Android Studio needs the libraries to have an id in order to match them with what"s running on the device.
-shared
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fms-extensions -fno-aligned-allocation -stdlib=libc++")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
set(CMAKE_CXX_EXTENSIONS OFF)
include(cmake/Platform/Common/TargetIncludeSystemDirectories_supported.cmake)
else()
message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported in ${PAL_PLATFORM_NAME}")
endif()
@@ -0,0 +1,10 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
@@ -0,0 +1,12 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
include(cmake/Platform/Common/LYWrappers_default.cmake)
@@ -0,0 +1,17 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
set(LY_PLATFORM_DETECTION_Android Android)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin)
set(LY_HOST_PLATFORM_DETECTION_Android Mac)
else()
set(LY_HOST_PLATFORM_DETECTION_Android ${CMAKE_HOST_SYSTEM_NAME})
endif()
+44
View File
@@ -0,0 +1,44 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
set(PAL_EXECUTABLE_APPLICATION_FLAG)
set(PAL_LINKOPTION_MODULE MODULE)
set(PAL_TRAIT_BUILD_HOST_GUI_TOOLS FALSE)
set(PAL_TRAIT_BUILD_HOST_TOOLS FALSE)
set(PAL_TRAIT_BUILD_SERVER_SUPPORTED FALSE)
set(PAL_TRAIT_BUILD_TESTS_SUPPORTED TRUE)
set(PAL_TRAIT_BUILD_UNITY_SUPPORTED TRUE)
set(PAL_TRAIT_BUILD_UNITY_EXCLUDE_EXTENSIONS)
set(PAL_TRAIT_BUILD_EXCLUDE_ALL_TEST_RUNS_FROM_IDE TRUE)
# Test library support
set(PAL_TRAIT_TEST_GOOGLE_TEST_SUPPORTED FALSE)
set(PAL_TRAIT_TEST_GOOGLE_BENCHMARK_SUPPORTED FALSE)
set(PAL_TRAIT_TEST_PYTEST_SUPPORTED FALSE)
set(PAL_TRAIT_TEST_TARGET_TYPE MODULE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(PAL_TRAIT_COMPILER_ID Clang)
set(PAL_TRAIT_COMPILER_ID_LOWERCASE clang)
else()
message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported in ${PAL_PLATFORM_NAME}")
endif()
# Set the default asset type for deployment
set(LY_ASSET_DEPLOY_ASSET_TYPE "es3" CACHE STRING "Set the asset type for deployment.")
# Set the python cmd tool
if(PAL_HOST_PLATFORM_NAME_LOWERCASE STREQUAL "windows")
set(LY_PYTHON_CMD ${CMAKE_CURRENT_SOURCE_DIR}/Tools/Python/python3.cmd)
else()
set(LY_PYTHON_CMD ${CMAKE_CURRENT_SOURCE_DIR}/Tools/Python/python3.sh)
endif()
@@ -0,0 +1,12 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
include(cmake/Platform/Common/RuntimeDependencies_common.cmake)
@@ -0,0 +1,85 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
if(LY_TOOLCHAIN_NDK_API_LEVEL)
return()
endif()
# Verify that the NDK environment is set and points to the support NDK
file(TO_CMAKE_PATH "${LY_NDK_DIR}" LY_NDK_DIR)
if(NOT LY_NDK_DIR)
message(FATAL_ERROR "Environment var for NDK is empty. Could not find the NDK installation folder")
endif()
set(LY_ANDROID_NDK_TOOLCHAIN ${LY_NDK_DIR}/build/cmake/android.toolchain.cmake)
if(NOT LY_NDK_DIR)
message(FATAL_ERROR "Invalid NDK Environment. Unable to locate android toolchain file: " ${LY_NDK_DIR})
endif()
# Set some default variables that are used by the NDK's toolchain file before processing
if(NOT ANDROID_ABI)
set(ANDROID_ABI arm64-v8a)
endif()
if(NOT ANDROID_ARM_MODE)
set(ANDROID_ARM_MODE arm)
endif()
if(NOT ANDROID_ARM_NEON)
set(ANDROID_ARM_NEON FALSE)
endif()
if(NOT ANDROID_NATIVE_API_LEVEL)
set(ANDROID_NATIVE_API_LEVEL 21)
endif()
# Make a backup of the CMAKE_FIND_ROOT_PATH since it will be altered by the NDK toolchain file and needs to be restored after the input
set(BACKUP_CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH})
include(${LY_ANDROID_NDK_TOOLCHAIN})
set(CMAKE_FIND_ROOT_PATH ${BACKUP_CMAKE_FIND_ROOT_PATH})
# Force the ANDROID_LINKER_FLAGS that are set in the NDK's toolchain file into the LINKER_FLAGS for the build and reset
# the standard libraries
set(LINKER_FLAGS ${ANDROID_LINKER_FLAGS})
set(CMAKE_CXX_STANDARD_LIBRARIES "")
# We need to pass down the Android API Level, and the Package Revision's Major and Minor number as preprocessor values.
# We will extract them from 'ANDROID_NDK_SOURCE_PROPERTIES' which will read from the NDK's properties file.
# (note: we cannot use 'ANDROID_NDK_REVISION' because the toolchain combines the Major and Minor revisions
string(REGEX MATCHALL "Pkg.Revision = (([0-9]+).([0-9]+).[0-9]+)" LY_NDK_PKG_REVISION_LINE ${ANDROID_NDK_SOURCE_PROPERTIES})
set(LY_TOOLCHAIN_NDK_PKG_MAJOR ${CMAKE_MATCH_2})
set(LY_TOOLCHAIN_NDK_PKG_MINOR ${CMAKE_MATCH_3})
set(LY_TOOLCHAIN_NDK_API_LEVEL ${ANDROID_PLATFORM_LEVEL})
set(MIN_NDK_VERSION 21)
if(${LY_TOOLCHAIN_NDK_PKG_MAJOR} VERSION_LESS ${MIN_NDK_VERSION})
message(FATAL_ERROR "Unsupported NDK Version ${LY_TOOLCHAIN_NDK_PKG_MAJOR}.${LY_TOOLCHAIN_NDK_PKG_MINOR}.${LY_TOOLCHAIN_NDK_API_LEVEL}. Must be version ${MIN_NDK_VERSION} or above")
else()
message(STATUS "Detected NDK Version ${LY_TOOLCHAIN_NDK_PKG_MAJOR}.${LY_TOOLCHAIN_NDK_PKG_MINOR}.${LY_TOOLCHAIN_NDK_PKG_MINOR}")
endif()
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES LY_NDK_DIR)
# The Native Activity Glue source file needs to be included in any project that will be loaded
# through the android launcher APK. This source file resides directly in the NDK source folder structure
# based on the configured NDK Path set with ${LY_NDK_DIR}
# Locate and verify the source folder based on the NDK path
set(LY_NDK_NATIVE_APP_GLUE_SRC_DIR "${LY_NDK_DIR}/sources/android/native_app_glue")
file(TO_CMAKE_PATH ${LY_NDK_NATIVE_APP_GLUE_SRC_DIR} LY_NDK_NATIVE_APP_GLUE_SRC_DIR)
if(NOT IS_DIRECTORY "${LY_NDK_NATIVE_APP_GLUE_SRC_DIR}")
message(FATAL_ERROR "Could not find android native app glue directory: ${LY_NDK_NATIVE_APP_GLUE_SRC_DIR}")
endif()
@@ -0,0 +1,21 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
set(FILES
../Common/Configurations_common.cmake
../Common/Clang/Configurations_clang.cmake
Configurations_android.cmake
LYTestWrappers_android.cmake
LYWrappers_android.cmake
PAL_android.cmake
PALDetection_android.cmake
Toolchain_android.cmake
)