Skip to content

Commit

Permalink
Better to use VCPKG_OSX_ARCHITECTURES in the triplet
Browse files Browse the repository at this point in the history
  • Loading branch information
retifrav committed Oct 1, 2023
1 parent aa217cd commit dd75fdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions toolchains/ios-fat.cmake
@@ -1,8 +1,9 @@
# for $ENV{VCPKG_ROOT} to work the triplet should contain `set(VCPKG_ENV_PASSTHROUGH_UNTRACKED VCPKG_ROOT)`
include("$ENV{VCPKG_ROOT}/scripts/toolchains/ios.cmake")

# to make a Mach-O combined/fat/universal binary, one needs to set both architectures
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
# to make a Mach-O combined/fat/universal binary, one needs to set both architectures,
# either here with `CMAKE_OSX_ARCHITECTURES` or in the triplet with `VCPKG_OSX_ARCHITECTURES`
#set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
# and set Xcode attributes to specify which architecture is for actual devices
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "arm64")
Expand Down
3 changes: 3 additions & 0 deletions triplets/decovar-arm64-ios-fat.cmake
Expand Up @@ -3,6 +3,9 @@ set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME iOS)
# to make a Mach-O combined/fat/universal binary, one needs to set both architectures,
# either here with `VCPKG_OSX_ARCHITECTURES` or in the chainloaded toolchain with `CMAKE_OSX_ARCHITECTURES`
set(VCPKG_OSX_ARCHITECTURES "arm64;x86_64")

# without this the VCPKG_ROOT environment variable won't be available in the chainloaded toolchain
set(VCPKG_ENV_PASSTHROUGH_UNTRACKED VCPKG_ROOT)
Expand Down

0 comments on commit dd75fdf

Please sign in to comment.