-
Notifications
You must be signed in to change notification settings - Fork 25k
fix build failure on windows in android #47641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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() | ||
|
|
||
|
Comment on lines
+48
to
+52
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC}) | ||
|
|
||
| target_include_directories(${CMAKE_PROJECT_NAME} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem: The variables REACT_ANDROID_DIR and BUILD_DIR might also contain backslashes if they are set on a Windows system. These backslashes need to be replaced to avoid similar issues.
Solution: Check if the script is running on Windows using if(CMAKE_HOST_WIN32). If it is, replace backslashes with forward slashes for these variables as well: