Skip to content

Commit

Permalink
Add arm64 windows prebuilt
Browse files Browse the repository at this point in the history
  • Loading branch information
KhoraLee authored and Macdu committed Mar 12, 2024
1 parent c03c738 commit ae12f72
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ jobs:
triplet: osx-release
vcpkg-root: /usr/local/share/vcpkg
extra-args: --overlay-triplets=./triplets
exclude:
- build: windows
arch: arm64

steps:
- uses: actions/checkout@v4

Expand Down
26 changes: 26 additions & 0 deletions triplets/arm64-win-llvm-static-release.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This triplet is tested in vcpkg ci via https://github.com/microsoft/vcpkg/pull/25897
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_BUILD_TYPE release)

## Toolchain setup
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/x64-win-llvm/x64-win-llvm.toolchain.cmake")
set(VCPKG_LOAD_VCVARS_ENV ON) # Setting VCPKG_CHAINLOAD_TOOLCHAIN_FILE deactivates automatic vcvars setup so reenable it!

if(DEFINED VCPKG_PLATFORM_TOOLSET)
set(VCPKG_PLATFORM_TOOLSET ClangCL)
endif()
set(VCPKG_ENV_PASSTHROUGH_UNTRACKED "LLVMInstallDir;LLVMToolsVersion") # For the ClangCL toolset
# set(VCPKG_QT_TARGET_MKSPEC win32-clang-msvc) # For Qt5

## Policy settings
set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled)
set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled)

set(VCPKG_CMAKE_CONFIGURE_OPTIONS
"-DCMAKE_TRY_COMPILE_CONFIGURATION=Release"
)

include("${CMAKE_CURRENT_LIST_DIR}/x64-win-llvm/extra_setup.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/x64-win-llvm/port_specialization.cmake")
5 changes: 4 additions & 1 deletion triplets/x64-win-llvm/x64-win-llvm.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ set(std_c_flags "-std:c11 -D__STDC__=1 -Wno-implicit-function-declaration") #/Zc

# Set Windows definitions:
set(windows_defs "/DWIN32")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
set(64BIT_ARCH x64 arm64)
if(VCPKG_TARGET_ARCHITECTURE IN_LIST 64BIT_ARCH)
string(APPEND windows_defs " /D_WIN64")
endif()
string(APPEND windows_defs " /D_WIN32_WINNT=0x0A00 /DWINVER=0x0A00") # tweak for targeted windows
Expand All @@ -55,6 +56,8 @@ set(arch_flags "-mcrc32")
# -msse4.2 for everything which normally cl can use. (Otherwise strict sse2 only.)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
string(APPEND arch_flags " -m32 --target=i686-pc-windows-msvc")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64)
string(APPEND arch_flags " --target=arm64-pc-windows-msvc")
endif()
# /Za unknown

Expand Down

0 comments on commit ae12f72

Please sign in to comment.