Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +11 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alespergl I'm not an expert of CMake, but can we wrap this change in a platform check?
Something like:

if(${CMAKE_SYSTEM_NAME} MATCHES "Win32") 
  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)
endif

I'm scared this could cause harm on other systems, otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using file(TO_CMAKE_PATH should actually be correct on every platform.
As the CI is green, we can just merge it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this operation should be cross-platform.

Note: There is a similar function cmake_path which seems to be preferred, but requires CMake 3.20 or later, whereas the minimum specified in this CMakeLists.txt is 3.13.


# If you have ccache installed, we're going to honor it.
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
Expand Down