From c4fd80f41426c25f421673d9d7068d33f079430f Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 5 Nov 2024 03:27:59 -0800 Subject: [PATCH] Use absolute path when compiling appmodules.so sources (#47379) Summary: Fixes https://github.com/facebook/react-native/issues/47352 This fixes a bug when the user is providing its own CMakeLists.txt file say because they want to compile more C++ code than we actually provide. Previously the `*.cpp` will evalute file in the current directory, meaning that the app's default `OnLoad.cpp` file would be ignored. ## Changelog: [ANDROID] [FIXED] - Use absolute path when compiling appmodules.so sources Pull Request resolved: https://github.com/facebook/react-native/pull/47379 Test Plan: Tested against the reproducer provided in: - Use absolute path when compiling appmodules.so sources Reviewed By: cipolleschi Differential Revision: D65428676 Pulled By: cortinico fbshipit-source-id: 7f3e4d470da0fffc5191c1a2c7e8fec517fee496 --- .../ReactAndroid/cmake-utils/ReactNative-application.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake b/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake index 451a066d2391b5..805ef1111ded66 100644 --- a/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake +++ b/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake @@ -36,7 +36,7 @@ if(CMAKE_HOST_WIN32) endif() file(GLOB input_SRC CONFIGURE_DEPENDS - *.cpp + ${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp ${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp) add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC})