Other: macOS 11 support.

Other: added option to force build arch on macOS.
Other: got rid of linker warnings when building go with macOS 11 compatibility.
This commit is contained in:
Xavier Michelon
2022-10-08 09:43:54 +02:00
parent d6bb165de5
commit b4b998df08
6 changed files with 35 additions and 9 deletions

View File

@ -19,6 +19,9 @@
include_guard()
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
if (NOT DEFINED BRIDGE_REPO_ROOT)
message(FATAL_ERROR "BRIDGE_REPO_ROOT is not defined.")
endif()
@ -71,10 +74,10 @@ if (APPLE)
if (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
message(STATUS "Building for Apple Silicon Mac computers")
set(VCPKG_TARGET_TRIPLET arm64-osx)
set(VCPKG_TARGET_TRIPLET arm64-osx-min-11-0)
elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
message(STATUS "Building for Intel based Mac computers")
set(VCPKG_TARGET_TRIPLET x64-osx)
set(VCPKG_TARGET_TRIPLET x64-osx-min-11-0)
else ()
message(FATAL_ERROR "Unknown value for CMAKE_OSX_ARCHITECTURE. Please use one of \"arm64\" and \"x86_64\". Multiple architectures are not supported.")
endif ()