Commit Graph

21 Commits

Author SHA1 Message Date
lumberyard-employee-dm f09055af42 Fixed CMake use with Android NDK 23 (#6460)
* Fixed CMake use with Android NDK 23

This was done by only setting the `ANDROID_ARM_MODE` if the ANDROID_ABI
starts with `armeabi`.

The Android arm mode setting can't be used using non-`armeabi` ABIs.
In O3DE we default to `arm64-v8a` `ANDROID_ABI`
So `ANDROID_ARM_MODE` must not be set.

The CMake [Android-Determine.cmake](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/Platform/Android-Determine.cmake#L573-585) which is used to detect platform-wide information when the CMAKE_SYSTEM_NAME is set to android, enforces that if the `CMAKE_ANDROID_ARCH_ABI` doesn't start with `armeabi`, then it will fatal error if the CMAKE_ANDROID_ARM_MODE option is set.

In Android NDK 21 the `ANDROID_ARM_MODE` variable is used to set the CMAKE_ANDROID_ARM_MODE variable if the [ANDROID_ABI](https://android.googlesource.com/platform/ndk/+/refs/tags/ndk-r21e/build/cmake/android.toolchain.cmake#700) starts with `armeabi`.

This meant when using Android NDK 21, the CMake Android-Determine.cmake module would succeed, due
to the CMAKE_ANDROID_ARM_MODE not being set.

In Android NDK 23 the `ANDROID_ARM_MODE` now will set the
`CMAKE_ANDROID_ARM_MODE` variable to `TRUE` if it isn't defined.

Added an `--extra-cmake-configure-args` option to the `generate_android_project.py` script which can be used to append user specified CMake arguments to the cmake configure step (`cmake -B <build-dir> -S <source-dir> -DCMAKE_TOOLCHAIN_FILE=<android-toolchain-file> <extra-args>`)

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Updated the O3DE Android toolchain wrapper to fatal error if the 64-bit
arm ABI isn't used.

Also removed the unneccessary setting of the ANDROID_ARM_MODE and
ANDROID_ARM_NEON option option now that the armeabi cannot be specified
as an ABI.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
2022-01-10 19:11:00 -06:00
AMZN-ScottR c0dd9ac26b [android_compat_fixes] fixed issues with running Android project generation scripts on Unix systems
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
2021-11-08 12:34:54 -08:00
AMZN-ScottR aabbf51d3a [android_compat_fixes] added support for non-NDK distributed Vulkan validation layer library paths (required for Android NDK r23+)
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
2021-11-08 12:34:51 -08:00
AMZN-ScottR 27d354b1f3 [android_compat_fixes] fixed issue where asset cached was getting deleted when regenerating an existing Android Gradle project with --overwrite-existing
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
2021-11-08 12:34:49 -08:00
AMZN-ScottR ea52fc93ef [android_compat_fixes] fixed issue with Gradle task chaining for some custom copy tasks
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
2021-11-08 12:34:38 -08:00
AMZN-ScottR 255bf7cfba [android_compat_fixes] updated min Android Gradle plugin version to latest point release of 4.2
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
2021-11-08 12:34:35 -08:00
AMZN-ScottR e532193459 [android_compat_fixes] added support for versioned Android 'cmdline-tools' (the 'tools' replacement)
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
2021-11-08 12:34:30 -08:00
SJ b984335b30 [Android] Fix black screen on Android when app is launched (#4418)
* When copying the runtime dependency setreg files to the cache, the name of the registry directory should be all lower case

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Lower case the registry folder name when looking in the asset cache.

Signed-off-by: amzn-sj <srikkant@amazon.com>
2021-10-01 09:02:09 -07:00
Steve Pham 87ae7e8653 Fix android gradle scripts to prevent cmake_dependencies.<game>.<game>_gamelauncher from being wiped out of the APK
Update gradle script generation to correct task dependencies (#3120)
- copyNativeArtifacts must run after syncLYLayoutMode
- syncLYLayoutMode must must after externalNativeBuild

Signed-off-by: Steve Pham <spham@amazon.com>
2021-08-13 18:22:40 -07:00
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00
Steve Pham b4a2edec6a Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
2021-06-30 19:51:55 -07:00
Steve Pham 70042fcdcd O3DE Copyright Updates for Linux Foundation (#1504) 2021-06-23 10:55:22 -07:00
SJ cb2d64b205 Add parameters to specify custom native build path and enable unity build in Android gradle builds (#1494)
* Add parameters to specify custom native build path and enable unity build in Android gradle builds

* Enable unity build for gradle to shorten the path to the generated object files which fixes build failures on Jenkins due to paths exceeding limit. This also speeds up builds.
2021-06-22 15:31:52 -07:00
Steve Pham 74ec7a362b Update Android Project Generation to support AGP 4.2.0, Cmake 3.20, and newer versions of NDK&SDK
- build.gradle format updates for newer Android Gradle Plugin
- Remove hard coded Android Gradle Plugin version 3.6.4 to be passed in from command args
- Set Android Gradle Plugin min version 4.2.0 in order to support Min CMake version 3.20
- Add ability to use the android sdk to install missing components if needed rather than doing it externally
- Removed argument to pass in the NDK folder to use the android, use the android-sdk instead. Can request specific NDK versions if possible
- Android Gradle Plugin has dependencies by version and is being managed
- More defaults based on tools on path, agp version made possible so they are no longer needed in the command args
2021-05-28 23:24:51 -07:00
alexpete 8469c9ca0a Integrating github/staging through commit 5f214be 2021-04-13 17:18:57 -07:00
alexpete c2cbd430fe Integrating up through commit 90f050496 2021-04-07 14:03:29 -07:00
Brian Herrera 39f53338bf Merge branch 'main' into LoadPipelineFromGitHub 2021-03-26 17:05:57 -07:00
alexpete 36c4e827bd Integrating latest from github/staging
Integrating up through commit 5e1bdae
2021-03-26 14:32:02 -07:00
Brian Herrera e8bbb5a0d5 Set scripts to be executable
This is required to build on linux/mac
2021-03-26 09:26:12 -07:00
alexpete 75dc720198 Integrating latest 47acbe8 2021-03-25 13:57:57 -07:00
alexpete a10351f38d Initial commit 2021-03-08 14:30:57 -08:00