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:
parent
8b50f64d68
commit
d5f588f520
|
@ -37,10 +37,10 @@ if (USE_RECOMMENDED_TRIPLETS)
|
|||
endif()
|
||||
|
||||
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)
|
||||
else()
|
||||
set(_WANTED_TRIPLET x64-osx-10.15-release)
|
||||
set(_WANTED_TRIPLET x64-osx-1015-release)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
|
@ -57,12 +57,20 @@ if (USE_RECOMMENDED_TRIPLETS)
|
|||
endif()
|
||||
|
||||
if (APPLE)
|
||||
if (_HOST_PROCESSOR STREQUAL arm64 AND _WANTED_TRIPLET MATCHES "-osx")
|
||||
if (_HOST_PROCESSOR MATCHES arm64)
|
||||
if (_WANTED_TRIPLET MATCHES "^arm64-osx-")
|
||||
set(_CAN_TARGET_AS_HOST ON)
|
||||
elseif (_WANTED_TRIPLET MATCHES "^x64-osx")
|
||||
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()
|
||||
|
||||
# If host and target triplet differ, vcpkg seems to always assume that the host can't run the target's binaries.
|
||||
# In cases like cross compiling from ARM -> Intel macOS, or target being an older version of the host OS, we *can* do that so the packages built targeting the host are redundant.
|
||||
|
|
Loading…
Reference in New Issue