From 054ab62be0db5d14f02f5aeb4c696f037ea68794 Mon Sep 17 00:00:00 2001 From: Ales Pergl Date: Mon, 4 Sep 2023 05:28:46 -0700 Subject: [PATCH] Fix building Android on Windows (#39190) Summary: Currently Android fails to build on Windows, because CMake cannot work with native Windows paths that are passed to it as build arguments. This change converts the input paths to the CMake format. ## Changelog: [Android] [Fixed] - Fix building Android on Windows. Pull Request resolved: https://github.com/facebook/react-native/pull/39190 Test Plan: Build the React Native Android project on Windows. It should complete successfully. Reviewed By: NickGerleman Differential Revision: D48948140 Pulled By: cortinico fbshipit-source-id: 6d584c2a10e683cdb6df0dd6dcd5875da7e06e2b --- .../react-native/ReactAndroid/src/main/jni/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt index 898afd3df13..6da7a5d592c 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt +++ b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt @@ -8,6 +8,11 @@ set(CMAKE_VERBOSE_MAKEFILE on) project(ReactAndroid) +# Convert input paths to CMake format (with forward slashes) +file(TO_CMAKE_PATH "${REACT_ANDROID_DIR}" REACT_ANDROID_DIR) +file(TO_CMAKE_PATH "${REACT_BUILD_DIR}" REACT_BUILD_DIR) +file(TO_CMAKE_PATH "${REACT_COMMON_DIR}" REACT_COMMON_DIR) + # If you have ccache installed, we're going to honor it. find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND)