From d1805dbd1c79e4fa2fc369574f03ff2d20a8001a Mon Sep 17 00:00:00 2001 From: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> Date: Tue, 2 Nov 2021 13:05:54 -0700 Subject: [PATCH] [android_compat_fixes] fixed Android NDK r23 duplicate __ANDROID_API__ define Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- cmake/Platform/Android/Configurations_android.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/Platform/Android/Configurations_android.cmake b/cmake/Platform/Android/Configurations_android.cmake index 69c481b50a..239d13e982 100644 --- a/cmake/Platform/Android/Configurations_android.cmake +++ b/cmake/Platform/Android/Configurations_android.cmake @@ -12,6 +12,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") include(cmake/Platform/Common/Configurations_common.cmake) include(cmake/Platform/Common/Clang/Configurations_clang.cmake) + set(_android_api_define) + if(${LY_TOOLCHAIN_NDK_PKG_MAJOR} VERSION_LESS "23") + set(_android_api_define __ANDROID_API__=${LY_TOOLCHAIN_NDK_API_LEVEL}) + endif() + ly_append_configurations_options( DEFINES LINUX64 @@ -22,9 +27,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 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} + ${_android_api_define} COMPILATION -femulated-tls # All accesses to TLS variables are converted to calls to __emutls_get_address in the runtime library