Skip to content

Commit b4d5676

Browse files
KhoraLeeAniLeo
authored andcommitted
Add arm64 windows prebuilt
1 parent 99e3e22 commit b4d5676

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ jobs:
3535
triplet: osx-release
3636
vcpkg-root: /usr/local/share/vcpkg
3737
extra-args: --overlay-triplets=./triplets
38-
exclude:
39-
- build: windows
40-
arch: arm64
38+
4139
steps:
4240
- uses: actions/checkout@v4
4341

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This triplet is tested in vcpkg ci via https://github.com/microsoft/vcpkg/pull/25897
2+
set(VCPKG_TARGET_ARCHITECTURE arm64)
3+
set(VCPKG_CRT_LINKAGE static)
4+
set(VCPKG_LIBRARY_LINKAGE static)
5+
set(VCPKG_BUILD_TYPE release)
6+
7+
## Toolchain setup
8+
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/x64-win-llvm/x64-win-llvm.toolchain.cmake")
9+
set(VCPKG_LOAD_VCVARS_ENV ON) # Setting VCPKG_CHAINLOAD_TOOLCHAIN_FILE deactivates automatic vcvars setup so reenable it!
10+
11+
if(DEFINED VCPKG_PLATFORM_TOOLSET)
12+
set(VCPKG_PLATFORM_TOOLSET ClangCL)
13+
endif()
14+
set(VCPKG_ENV_PASSTHROUGH_UNTRACKED "LLVMInstallDir;LLVMToolsVersion") # For the ClangCL toolset
15+
# set(VCPKG_QT_TARGET_MKSPEC win32-clang-msvc) # For Qt5
16+
17+
## Policy settings
18+
set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled)
19+
set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled)
20+
21+
set(VCPKG_CMAKE_CONFIGURE_OPTIONS
22+
"-DCMAKE_TRY_COMPILE_CONFIGURATION=Release"
23+
)
24+
25+
include("${CMAKE_CURRENT_LIST_DIR}/x64-win-llvm/extra_setup.cmake")
26+
include("${CMAKE_CURRENT_LIST_DIR}/x64-win-llvm/port_specialization.cmake")

triplets/x64-win-llvm/x64-win-llvm.toolchain.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ set(std_c_flags "-std:c11 -D__STDC__=1 -Wno-implicit-function-declaration") #/Zc
3535

3636
# Set Windows definitions:
3737
set(windows_defs "/DWIN32")
38-
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
38+
set(64BIT_ARCH x64 arm64)
39+
if(VCPKG_TARGET_ARCHITECTURE IN_LIST 64BIT_ARCH)
3940
string(APPEND windows_defs " /D_WIN64")
4041
endif()
4142
string(APPEND windows_defs " /D_WIN32_WINNT=0x0A00 /DWINVER=0x0A00") # tweak for targeted windows
@@ -55,6 +56,8 @@ set(arch_flags "-mcrc32")
5556
# -msse4.2 for everything which normally cl can use. (Otherwise strict sse2 only.)
5657
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
5758
string(APPEND arch_flags " -m32 --target=i686-pc-windows-msvc")
59+
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64)
60+
string(APPEND arch_flags " --target=arm64-pc-windows-msvc")
5861
endif()
5962
# /Za unknown
6063

0 commit comments

Comments
 (0)