diff --git a/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake b/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake index a5b3a19423b..2aeb9f5c46c 100644 --- a/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake +++ b/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake @@ -32,7 +32,8 @@ endif(CCACHE_FOUND) set(BUILD_DIR ${PROJECT_BUILD_DIR}) if(CMAKE_HOST_WIN32) - string(REPLACE "\\" "/" BUILD_DIR ${BUILD_DIR}) + string(REPLACE "\\" "/" BUILD_DIR ${BUILD_DIR}) + string(REPLACE "\\" "/" REACT_ANDROID_DIR ${REACT_ANDROID_DIR}) endif() if (PROJECT_ROOT_DIR) @@ -44,6 +45,11 @@ file(GLOB input_SRC CONFIGURE_DEPENDS ${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp ${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp) +# Ensure that `input_SRC` paths use forward slashes +foreach(path IN LISTS input_SRC) + string(REPLACE "\\" "/" path "${path}") +endforeach() + add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC}) target_include_directories(${CMAKE_PROJECT_NAME}