2020-08-27 23:43:06 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
. "${PROJECT_DIR}/Scripts/create_xcframework_func.sh"
|
|
|
|
|
2024-03-07 14:50:26 -05:00
|
|
|
prod_name="MoltenVK"
|
2020-08-27 23:43:06 -04:00
|
|
|
export MVK_XCFWK_STAGING_DIR="${BUILD_DIR}/XCFrameworkStaging"
|
|
|
|
|
|
|
|
# Assemble the headers
|
|
|
|
hdr_dir="${MVK_XCFWK_STAGING_DIR}/Headers"
|
|
|
|
mkdir -p "${hdr_dir}"
|
Improve support for iOS App Store rules by using dynamic XCFramework.
Apple's iOS App Store does not permit an app to link to naked dylibs.
Instead, these must be placed in frameworks, which are embedded in a
dynamic version of MoltenVK.xcframework.
- Use Xcode to directly generate a MoltenVK.framework for each platform,
and remove create_dylib*.sh scripts.
- Move static XCFramework, containing libMoltenVK.a static libraries,
to Package/Latest/MoltenVK/static/MoltenVK.xcframework.
- Generate dynamic XCFramework, containing MoltenVK.framework dynamic
libraries, in Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework.
- Add macro MVK_VERSION_STRING to create version string at compile time,
use it to validate the CURRENT_PROJECT_VERSION build setting at compile time,
and use it at runtime instead of mvkGetMoltenVKVersionString() function.
- Add -w to OTHER_LDFLAGS to dynamic framework builds to suppress
spurious linker warnings of the type
"ld: warning: no platform load command found in '...', assuming: iOS"
issued from the new linker introduced in Xcode 15.
- Add MoltenVK-MacCat Xcode target and MoltenVK Package (MacCat only)
Xcode scheme to avoid building dynamic MoltenVK.framework for the
Mac Catalyst platform, because Xcode does not support doing so.
- Always run MoltenVK build scripts, to ensure all components are
added to the XCFrameworks, and MoltenVK/Package is always refreshed,
even if code compilation is not required.
- Cube demo link to dynamic MoltenVK.framework through
dynamic/MoltenVK.xcframework, instead of to naked libMoltenVK.dylib.
- Update the version of Volk used by the Cube demo, to support
loading MoltenVK from dynamic frameworks inside Volk.
- Update README.md and MoltenVK_Runtime_UserGuide.md documents.
- Update MVK_PRIVATE_API_VERSION to 40.
- Fix make install to install /usr/local/lib/libMoltenVK.dylib on macOS (unrelated).
- Remove unused MTLAttributeStrideStatic declaration prior to Xcode 15 (unrelated).
2024-02-29 22:03:44 -05:00
|
|
|
rm -rf "${hdr_dir}/${prod_name}"
|
|
|
|
cp -pRL "${PROJECT_DIR}/${prod_name}/include/${prod_name}" "${hdr_dir}"
|
2020-08-27 23:43:06 -04:00
|
|
|
|
Improve support for iOS App Store rules by using dynamic XCFramework.
Apple's iOS App Store does not permit an app to link to naked dylibs.
Instead, these must be placed in frameworks, which are embedded in a
dynamic version of MoltenVK.xcframework.
- Use Xcode to directly generate a MoltenVK.framework for each platform,
and remove create_dylib*.sh scripts.
- Move static XCFramework, containing libMoltenVK.a static libraries,
to Package/Latest/MoltenVK/static/MoltenVK.xcframework.
- Generate dynamic XCFramework, containing MoltenVK.framework dynamic
libraries, in Package/Latest/MoltenVK/dynamic/MoltenVK.xcframework.
- Add macro MVK_VERSION_STRING to create version string at compile time,
use it to validate the CURRENT_PROJECT_VERSION build setting at compile time,
and use it at runtime instead of mvkGetMoltenVKVersionString() function.
- Add -w to OTHER_LDFLAGS to dynamic framework builds to suppress
spurious linker warnings of the type
"ld: warning: no platform load command found in '...', assuming: iOS"
issued from the new linker introduced in Xcode 15.
- Add MoltenVK-MacCat Xcode target and MoltenVK Package (MacCat only)
Xcode scheme to avoid building dynamic MoltenVK.framework for the
Mac Catalyst platform, because Xcode does not support doing so.
- Always run MoltenVK build scripts, to ensure all components are
added to the XCFrameworks, and MoltenVK/Package is always refreshed,
even if code compilation is not required.
- Cube demo link to dynamic MoltenVK.framework through
dynamic/MoltenVK.xcframework, instead of to naked libMoltenVK.dylib.
- Update the version of Volk used by the Cube demo, to support
loading MoltenVK from dynamic frameworks inside Volk.
- Update README.md and MoltenVK_Runtime_UserGuide.md documents.
- Update MVK_PRIVATE_API_VERSION to 40.
- Fix make install to install /usr/local/lib/libMoltenVK.dylib on macOS (unrelated).
- Remove unused MTLAttributeStrideStatic declaration prior to Xcode 15 (unrelated).
2024-02-29 22:03:44 -05:00
|
|
|
export MVK_XCFWK_DEST_DIR="${PROJECT_DIR}/Package/${CONFIGURATION}/${prod_name}/static"
|
|
|
|
create_xcframework "${prod_name}" "library"
|
|
|
|
|
|
|
|
export MVK_XCFWK_DEST_DIR="${PROJECT_DIR}/Package/${CONFIGURATION}/${prod_name}/dynamic"
|
|
|
|
create_xcframework "${prod_name}" "framework"
|