macOS cross compiling fixes

- can't use the x86_64 one as host triplet on arm64 because building Qt
  fails for whatever reason. Because of course it does :D
- vcpkg doesn't always like periods in triplet names so removed those
This commit is contained in:
Nadia Holmquist Pedersen 2023-11-16 14:04:04 +01:00
parent 8b50f64d68
commit d5f588f520
3 changed files with 14 additions and 6 deletions

View File

@ -37,10 +37,10 @@ if (USE_RECOMMENDED_TRIPLETS)
endif() endif()
if (CMAKE_OSX_ARCHITECTURES STREQUAL arm64) if (CMAKE_OSX_ARCHITECTURES STREQUAL arm64)
set(_WANTED_TRIPLET arm64-osx-11.0-release) set(_WANTED_TRIPLET arm64-osx-11-release)
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0) set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
else() else()
set(_WANTED_TRIPLET x64-osx-10.15-release) set(_WANTED_TRIPLET x64-osx-1015-release)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
endif() endif()
elseif(WIN32) elseif(WIN32)
@ -57,10 +57,18 @@ if (USE_RECOMMENDED_TRIPLETS)
endif() endif()
if (APPLE) if (APPLE)
if (_HOST_PROCESSOR STREQUAL arm64 AND _WANTED_TRIPLET MATCHES "-osx") if (_HOST_PROCESSOR MATCHES arm64)
set(_CAN_TARGET_AS_HOST ON) if (_WANTED_TRIPLET MATCHES "^arm64-osx-")
elseif (_WANTED_TRIPLET MATCHES "^x64-osx") set(_CAN_TARGET_AS_HOST ON)
set(_CAN_TARGET_AS_HOST ON) elseif (_WANTED_TRIPLET STREQUAL "x64-osx-1015-release")
# Use the default triplet for when building for arm64
# because we're probably making a universal build
set(VCPKG_HOST_TRIPLET arm64-osx-11-release)
endif()
else()
if (_WANTED_TRIPLET MATCHES "^x64-osx-")
set(_CAN_TARGET_AS_HOST ON)
endif()
endif() endif()
endif() endif()