From 5c8ce8db664507c5b1aa7d6e38e98f0ea646ede3 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Sun, 13 Jul 2025 15:49:26 -0400 Subject: [PATCH] build(vcpkg): add univesal-osx triplet vcpkg doesn't officially support universal binaries, but this should function as a workaround until it does one day Signed-off-by: Seth Flynn --- cmake/macosPreset.json | 3 ++- cmake/vcpkg-triplets/universal-osx.cmake | 8 ++++++++ vcpkg-configuration.json | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 cmake/vcpkg-triplets/universal-osx.cmake diff --git a/cmake/macosPreset.json b/cmake/macosPreset.json index de503d7a2..9098f9a9a 100644 --- a/cmake/macosPreset.json +++ b/cmake/macosPreset.json @@ -22,7 +22,8 @@ "macos_base" ], "cacheVariables": { - "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64" + "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64", + "VCPKG_TARGET_TRIPLET": "universal-osx" } }, { diff --git a/cmake/vcpkg-triplets/universal-osx.cmake b/cmake/vcpkg-triplets/universal-osx.cmake new file mode 100644 index 000000000..1c91a5650 --- /dev/null +++ b/cmake/vcpkg-triplets/universal-osx.cmake @@ -0,0 +1,8 @@ +# See https://github.com/microsoft/vcpkg/discussions/19454 +# NOTE: Try to keep in sync with default arm64-osx definition +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64") diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 610f6b31d..3a59b2658 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -10,5 +10,8 @@ "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", "name": "microsoft" } + ], + "overlay-triplets": [ + "./cmake/vcpkg-triplets" ] }