Skip to content

Commit 2c45675

Browse files
cortinicofacebook-github-bot
authored andcommitted
RNGP - Pass PROJECT_ROOT_DIR to CMake (facebook#46958)
Summary: Pull Request resolved: facebook#46958 This will make it easier to link against custom C++ TM which will most likely live inside ./shared or some other paths outside of ./android. CMake will have access to `PROJECT_ROOT_DIR` which points to ./android (the folder where the settings.gradle file exists). Changelog: [Internal] [Changed] - RNGP - Pass PROJECT_ROOT_DIR to CMake Reviewed By: cipolleschi Differential Revision: D64183641 fbshipit-source-id: 347256c04f10e92cf5a13e9c70db16aa29bcb741
1 parent b69a92e commit 2c45675

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/NdkConfiguratorUtils.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ internal object NdkConfiguratorUtils {
4343
if (cmakeArgs.none { it.startsWith("-DPROJECT_BUILD_DIR") }) {
4444
cmakeArgs.add("-DPROJECT_BUILD_DIR=${project.layout.buildDirectory.get().asFile}")
4545
}
46+
if (cmakeArgs.none { it.startsWith("-DPROJECT_ROOT_DIR") }) {
47+
cmakeArgs.add("-DPROJECT_ROOT_DIR=${project.rootProject.layout.projectDirectory.asFile}")
48+
}
4649
if (cmakeArgs.none { it.startsWith("-DREACT_ANDROID_DIR") }) {
4750
cmakeArgs.add(
4851
"-DREACT_ANDROID_DIR=${extension.reactNativeDir.file("ReactAndroid").get().asFile}")

0 commit comments

Comments
 (0)