Skip to content

Commit

Permalink
Merge pull request #2136 from billhollings/add-ios-simulator-dylib
Browse files Browse the repository at this point in the history
Support libMoltenVK.dylib for iOS Simulator architecture.
  • Loading branch information
billhollings authored Jan 23, 2024
2 parents 133a49c + 7f75502 commit 680b9d4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
25 changes: 24 additions & 1 deletion Demos/Cube/Cube.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -269,6 +269,7 @@
A9B53B2E1C3AC15200ABC6F6 /* Resources */,
A9B53B331C3AC15200ABC6F6 /* Sources */,
A90998A12B4EFA78002CEF67 /* Copy MoltenVK Library */,
A90998AE2B602480002CEF67 /* Copy MoltenVK Simulator Library */,
A9B53B371C3AC15200ABC6F6 /* Frameworks */,
);
buildRules = (
Expand Down Expand Up @@ -352,6 +353,28 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
A90998AE2B602480002CEF67 /* Copy MoltenVK Simulator Library */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Copy MoltenVK Simulator Library";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/bash\n\n# If running on the simulator, we need to overwrite the \n# iOS build of MoltenVK with the iOS Simulator build.\n# We can't use this script to copy the iOS build itself, \n# because it needs to be signed to run on an actual device.\n# The simulator build does not need to be signed.\nif [[ \"${PLATFORM_NAME}\" == \"iphonesimulator\" ]]; then \n\tmvk_lib_file=\"libMoltenVK.dylib\"\n\tmvk_lib_dir=\"${PROJECT_DIR}/../../MoltenVK/dylib/iOS-simulator\"\n\tapp_fwk_dir=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Frameworks\"\n\tcp -af \"${mvk_lib_dir}/${mvk_lib_file}\" \"${app_fwk_dir}/${mvk_lib_file}\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
A93DBF4024A2A4D500079F64 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
3 changes: 2 additions & 1 deletion Demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ The demo can be found in the `Cube` folder, and in the `Cube` group in the
*Xcode Project Navigator* in the `Demos.xcworkspace` *Xcode* workspace.

To run this demo, run the `Cube-macOS`, `Cube-iOS`, or `Cube-tvOS` *Scheme* from within *Xcode*.
In addition to devices, this demo will also run on the `iOS Simulator` or `tvOS Simulator` destinations.
In addition to devices, this demo will also run on an `iOS Simulator` destination.
This demo is not supported on a `tvOS Simulator` destination.

The `Cube` demo is a simple example of installing **MoltenVK** as a `libMoltenVK.dylib` library that
is dynamically linked to the application, and the _Vulkan_ calls all use _Volk_ to dynamically access
Expand Down
3 changes: 2 additions & 1 deletion Docs/Whats_New.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Released TBD

- Fix potential crash when using multi-planar images.
- Ensure buffers available for buffer addresses in push constants.

- Support `libMoltenVK.dylib` for _iOS Simulator_ architecture.
- Restore support for _iOS Simulator_ destination in recent update to _Cube_ demo that uses dynamic-linking.


MoltenVK 1.2.7
Expand Down
2 changes: 0 additions & 2 deletions MoltenVK/MoltenVK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2027,7 +2027,6 @@
MTL_ENABLE_DEBUG_INFO = YES;
MVK_SKIP_DYLIB = "";
"MVK_SKIP_DYLIB[sdk=appletvsimulator*]" = YES;
"MVK_SKIP_DYLIB[sdk=iphonesimulator*]" = YES;
PRELINK_LIBS = "${CONFIGURATION_BUILD_DIR}/libMoltenVKShaderConverter.a";
PRODUCT_NAME = MoltenVK;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -2098,7 +2097,6 @@
MTL_ENABLE_DEBUG_INFO = NO;
MVK_SKIP_DYLIB = "";
"MVK_SKIP_DYLIB[sdk=appletvsimulator*]" = YES;
"MVK_SKIP_DYLIB[sdk=iphonesimulator*]" = YES;
PRELINK_LIBS = "${CONFIGURATION_BUILD_DIR}/libMoltenVKShaderConverter.a";
PRODUCT_NAME = MoltenVK;
SKIP_INSTALL = YES;
Expand Down

0 comments on commit 680b9d4

Please sign in to comment.