Skip to content

Commit cd28d44

Browse files
authored
Fix finding patch executable when cross-compiling on windows. (#627)
`WIN32` checks whether current build context is windows. This is not correct in case of cross-compiling, because we are interested in finding host's tools, not SDK's tools.
1 parent 2a9e203 commit cd28d44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/CPM.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ function(cpm_add_patches)
490490

491491
# Find the patch program.
492492
find_program(PATCH_EXECUTABLE patch)
493-
if(WIN32 AND NOT PATCH_EXECUTABLE)
493+
if(CMAKE_HOST_WIN32 AND NOT PATCH_EXECUTABLE)
494494
# The Windows git executable is distributed with patch.exe. Find the path to the executable, if
495495
# it exists, then search `../usr/bin` and `../../usr/bin` for patch.exe.
496496
find_package(Git QUIET)

0 commit comments

Comments
 (0)