Skip to content

Commit

Permalink
feat: cross-compile to Windows ARM (#326)
Browse files Browse the repository at this point in the history
* feat: cross-compile to Windows ARM

* fix: add support for winarm download

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Dec 20, 2022
1 parent d21893f commit 6674721
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ jobs:
arch: "AMD64"
build: ""
use_qemu: false
- os: windows-2022
arch: "ARM64"
build: ""
use_qemu: false
- os: windows-2019
arch: "x86"
build: ""
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ if(CMakePythonDistributions_SUPERBUILD)
endif()
if(WIN32)
set(binary_archive "win32_binary")
if((CMAKE_SIZEOF_VOID_P EQUAL 8) AND NOT(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ARM64"))
set(binary_archive "win64_binary")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ARM64" OR "$ENV{SETUPTOOLS_EXT_SUFFIX}" MATCHES arm64)
set(binary_achive "winarm64_binary")
else()
set(binary_archive "win64_binary")
endif()
endif()
endif()
check_archive_var("${binary_archive}")
Expand Down
3 changes: 3 additions & 0 deletions CMakeUrls.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ set(win32_binary_sha256 "ddd115257a19ff3dd18fc63f32a00ae742f8b62d2e39bc3546

set(win64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.25.0/cmake-3.25.0-windows-x86_64.zip")
set(win64_binary_sha256 "b46030c10cab1170355952f9ac59f7e6dabc248070fc53f15dff11d4ed2910f8")

set(winarm64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.25.0/cmake-3.25.0-windows-arm64.zip")
set(winarm64_binary_sha256 "350e4a6361329cb6245b59a5eeb59ce96e2980ce5d149cd5384f6009eec04c9f")
4 changes: 4 additions & 0 deletions scripts/update_cmake_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def get_cmake_archive_urls_and_sha256s(version, verbose=False):
"cmake-%s-macos10.10-universal.tar.gz" % version: "macos10_10_binary",
"cmake-%s-windows-i386.zip" % version: "win32_binary",
"cmake-%s-windows-x86_64.zip" % version: "win64_binary",
"cmake-%s-windows-arm64.zip" % version: "winarm64_binary",
}

# Get SHA256s for each asset
Expand Down Expand Up @@ -137,6 +138,9 @@ def generate_cmake_variables(urls_and_sha256s):
set(win64_binary_url "{win64_binary_url}")
set(win64_binary_sha256 "{win64_binary_sha256}")
set(winarm64_binary_url "{winarm64_binary_url}")
set(winarm64_binary_sha256 "{winarm64_binary_sha256}")
"""
).format(**template_inputs)

Expand Down

0 comments on commit 6674721

Please sign in to comment.