More reliable way to get ReactAndroid build dir in Android-prebuilt.mk (#30222)

Summary:
Pass the ReactAndroid project build directory as a variable to the ndk build so it can be used instead of assuming that the build directory is under ReactAndroid/build.

## Changelog

[Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/30222

Test Plan: Tested in an app with a custom build directory

Reviewed By: yungsters

Differential Revision: D24560643

Pulled By: fkgozali

fbshipit-source-id: cc65a70582f546ca2e2ca9fb6a2ff03ea70ca9d8
This commit is contained in:
Janic Duplessis
2020-10-27 10:04:45 -07:00
committed by Facebook GitHub Bot
parent 4630e57821
commit 1e9d7b70fc
2 changed files with 2 additions and 5 deletions
-4
View File
@@ -14,10 +14,6 @@
LOCAL_PATH := $(call my-dir)
REACT_ANDROID_DIR := $(LOCAL_PATH)
# TODO: Find a better way without pointing to ReactAndroid/build dir.
REACT_ANDROID_BUILD_DIR := $(REACT_ANDROID_DIR)/build
FIRST_PARTY_NDK_DIR := $(REACT_ANDROID_DIR)/src/main/jni/first-party
THIRD_PARTY_NDK_DIR := $(REACT_ANDROID_BUILD_DIR)/third-party-ndk
REACT_ANDROID_SRC_DIR := $(REACT_ANDROID_DIR)/src/main
+2 -1
View File
@@ -256,7 +256,8 @@ if (enableCodegen) {
// The following paths assume building React Native from source.
"GENERATED_SRC_DIR=$buildDir/generated/source",
"PROJECT_BUILD_DIR=$buildDir",
"REACT_ANDROID_DIR=$reactAndroidProjectDir"
"REACT_ANDROID_DIR=$reactAndroidProjectDir",
"REACT_ANDROID_BUILD_DIR=$reactAndroidBuildDir"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++1y"
targets "rntester_appmodules"