Skip to content

Commit

Permalink
[vcpkg scripts] enable patchelf on windows for cross-compiling toolch…
Browse files Browse the repository at this point in the history
…ains (#41578)
  • Loading branch information
cenit authored Oct 17, 2024
1 parent a149f4a commit 1059769
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/cmake/vcpkg_find_acquire_program(PATCHELF).cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(program_name patchelf)
set(program_version 0.14.5)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(program_version 0.14.5)
vcpkg_execute_in_download_mode(COMMAND "uname" "-m" OUTPUT_VARIABLE HOST_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
if(HOST_ARCH STREQUAL "aarch64")
set(patchelf_platform "aarch64")
Expand All @@ -16,4 +16,15 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(download_urls "https://github.com/NixOS/patchelf/releases/download/${program_version}/${download_filename}")
set(tool_subdirectory "${program_version}-${patchelf_platform}-linux")
set(paths_to_search "${DOWNLOADS}/tools/patchelf/${program_version}-${patchelf_platform}-linux/bin")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(patchelf_host "win32")
set(program_version 0.18.0)
set(download_sha512
"19d24f64bea6d6236292455a09695d289ddca71433a0ccaf372f57da80a4cde5db1c375ac8e29a41ac1f0676b7d3b56ce5b2baf39e58369c4f741b612db51044")
set(download_filename "${program_name}-${patchelf_host}-${program_version}.exe")
set(download_urls "https://github.com/NixOS/patchelf/releases/download/${program_version}/${download_filename}")
set(tool_subdirectory "${program_version}-${patchelf_host}")
set(paths_to_search "${DOWNLOADS}/tools/patchelf/${program_version}-${patchelf_host}/")
set(raw_executable ON)
set(rename_binary_to "patchelf.exe")
endif()

0 comments on commit 1059769

Please sign in to comment.