From 4d003bf2562fd4fff64c0c7918f6f570cd821c50 Mon Sep 17 00:00:00 2001 From: Bill Hollings Date: Tue, 15 Nov 2022 18:48:36 -0500 Subject: [PATCH] Document new linkage model used by Xcode 14 and later, and how to link MoltenVK to an app or game using Xcode 13 or earlier. --- Docs/MoltenVK_Runtime_UserGuide.md | 14 ++++++++++++++ Docs/Whats_New.md | 3 ++- README.md | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md index 6582dbcf..0d5fce4d 100644 --- a/Docs/MoltenVK_Runtime_UserGuide.md +++ b/Docs/MoltenVK_Runtime_UserGuide.md @@ -87,6 +87,20 @@ as an `XCFramework`, as it is the simpler option, and encompasses the largest se ### Install *MoltenVK* as a Universal `XCFramework` +> ***Note:*** *Xcode 14* introduced a new static linkage model that is not compatible with previous +versions of *Xcode*. If you link to a `MoltenVK.xcframework` that was built with *Xcode 14* or later, +also use *Xcode 14* or later to link it to your app or game. +> +> If you need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` to your app or game, +first [build](../README.md#building) **MoltenVK** with *Xcode 13* or earlier. +> +> Or, if you want to use *Xcode 14* or later to [build](../README.md#building) **MoltenVK**, in order to be able to use the latest +*Metal* capabilities, but need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` to your +app or game, first add the value `-fno-objc-msgsend-selector-stubs` to the `OTHER_CFLAGS` +*Xcode* build setting in the `MoltenVK.xcodeproj` and `MoltenVKShaderConverter.xcodeproj` *Xcode* +projects, [build](../README.md#building) **MoltenVK** with *Xcode 14* or later, and then link `MoltenVK.xcframework` +to your app or game using *Xcode 13* or earlier. + To link **MoltenVK** to your application as an `XCFramework`, follow these steps: 1. Open your application in *Xcode* and select your application's target in the diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md index e4d0a00d..3bf5cebd 100644 --- a/Docs/Whats_New.md +++ b/Docs/Whats_New.md @@ -20,7 +20,8 @@ Released TBD - Fix crash on descriptor update with out-of-bounds descriptor count data. - Work around `MTLCounterSet` crash on additional Intel Iris Plus Graphics devices. - +- Document new linkage model used by *Xcode 14* and later, and how to link **MoltenVK** + to an app or game using *Xcode 13* or earlier. MoltenVK 1.2.0 diff --git a/README.md b/README.md index 6b2e2006..0a73715e 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,20 @@ Building **MoltenVK** During building, **MoltenVK** references the latest *Apple SDK* frameworks. To access these frameworks, and to avoid build errors, be sure to use the latest publicly available version of *Xcode*. +> ***Note:*** *Xcode 14* introduced a new static linkage model that is not compatible with previous +versions of *Xcode*. If you link to a `MoltenVK.xcframework` that was built with *Xcode 14* or later, +also use *Xcode 14* or later to link it to your app or game. +> +> If you need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` to your app or game, +first build **MoltenVK** with *Xcode 13* or earlier. +> +> Or, if you want to use *Xcode 14* or later to build **MoltenVK**, in order to be able to use the +latest *Metal* capabilities, but need to use *Xcode 13* or earlier to link `MoltenVK.xcframework` +to your app or game, first add the value `-fno-objc-msgsend-selector-stubs` to the `OTHER_CFLAGS` +*Xcode* build setting in the `MoltenVK.xcodeproj` and `MoltenVKShaderConverter.xcodeproj` *Xcode* +projects, build **MoltenVK** with *Xcode 14* or later, and then link `MoltenVK.xcframework` +to your app or game using *Xcode 13* or earlier. + **MoltenVK** can be built to support at least *macOS 10.11*, *iOS 9*, or *tvOS 9*, but the default _Xcode_ build settings in the included _Xcode_ projects are set to a minimum deployment target of *macOS 10.13*, *iOS 11*, and *tvOS 11*, which are the oldest OS versions supported by the current