Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuring ndk build architectures (#31232)
Summary: Building from source in debug takes a very long time because native builds need to run for all supported architectures. It is possible to check which architecture the devices for which we are about to launch the app on are and build only for those. For most cases we can reduce the number of architectures we build for to 1 instead of 4, resulting in a large speedup of the build. This is inspired by iOS which has a "Build for active architecture only" option. Since android doesn't really support this natively we can implement it here and also in react-native by reading the build properties that we pass and alter the abi we build for. With fabric / codegen coming up I suspect that we might want to default to building c++ soon. This should ease the transition as builds won't be orders of magnitude slower. See react-native-community/cli#1388 for more context and how we use this new config to automatically detect running emulator architectures. ## Changelog [Android] [Added] - Allow configuring ndk build architectures Pull Request resolved: #31232 Test Plan: Tested by setting reactNativeDebugArchitectures with different values in gradle.properties. Checked the build logs to see which architectures are being built. Also made sure release builds are not affected by this value. Clean build reactNativeDebugArchitectures not set 824.41s reactNativeDebugArchitectures=x86 299.77s Reviewed By: mdvacca Differential Revision: D29613939 Pulled By: ShikaSD fbshipit-source-id: d20a23d1d9bbf33f5afaaf3475f208a2e48c0e1a
- Loading branch information