Skip to content

Commit

Permalink
Fix finding patch executable when cross-compiling on windows. (#627)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
rokups authored Dec 29, 2024
1 parent 2a9e203 commit cd28d44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ function(cpm_add_patches)

# Find the patch program.
find_program(PATCH_EXECUTABLE patch)
if(WIN32 AND NOT PATCH_EXECUTABLE)
if(CMAKE_HOST_WIN32 AND NOT PATCH_EXECUTABLE)
# The Windows git executable is distributed with patch.exe. Find the path to the executable, if
# it exists, then search `../usr/bin` and `../../usr/bin` for patch.exe.
find_package(Git QUIET)
Expand Down

0 comments on commit cd28d44

Please sign in to comment.