Skip to content

Commit 671760c

Browse files
authored
vcpkg: Support Windows and arm64 (#478)
* Support arm64 default vcpkg triplet * Add default Windows release triplet support
1 parent ab27539 commit 671760c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

cmake/vcpkg_helper.cmake

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,24 @@ if (NOT USE_SYSTEM_DEPENDENCIES)
1919

2020
# Set default triplet to Release VCPKG build unless we can't find it
2121
if (NOT DEFINED VCPKG_TARGET_TRIPLET)
22+
set(_project_arch "x64")
23+
if (UNIX)
24+
execute_process(COMMAND uname -m
25+
OUTPUT_VARIABLE _SYSTEM_ARCH
26+
OUTPUT_STRIP_TRAILING_WHITESPACE)
27+
else()
28+
message(WARNING "No detection of architecture for this platform. Assuming x64")
29+
endif()
30+
if (_SYSTEM_ARCH MATCHES "^[Aa][Aa][Rr][Cc][Hh]64$")
31+
set(_project_arch "arm64")
32+
endif()
33+
2234
if (APPLE)
23-
set(_project_vcpkg_triplet "x64-osx-rel")
35+
set(_project_vcpkg_triplet "${_project_arch}-osx-rel")
2436
elseif(UNIX)
25-
set(_project_vcpkg_triplet "x64-linux-rel")
37+
set(_project_vcpkg_triplet "${_project_arch}-linux-rel")
38+
elseif(WIN32)
39+
set(_project_vcpkg_triplet "${_project_arch}-windows-static-md-rel")
2640
else()
2741
message(FATAL_ERROR "Could not detect default release triplet")
2842
endif()

0 commit comments

Comments
 (0)