From 56df7d61d72431451674bb6eccf8ce2a80f9288e Mon Sep 17 00:00:00 2001 From: Bill Hollings Date: Tue, 1 Sep 2020 14:39:46 -0400 Subject: [PATCH] Remove MoltenVK fat libraries and frameworks and use XCFramework instead. - Delete fat library and framework scripts and templates. - MoltenVK build package now only includes one XCFramework, and separate platform dylibs. - Modify fetchDependencies and Makefile targets to not build fat libraries, and to build simulators separately than platforms instead. - Script package_moltenvk.sh now copies dylibs for all built platforms. - Consolidate package_all.sh and delete package_one_os.sh. - Swap names of copy_lib_to_staging.sh and copy_to_staging.sh scripts. - Cube demo now uses MoltenVK as XCFramework, and support Simulator builds. - Hologram demo now uses MoltenVK as dylibs from new packaging location. - API-Samples demo now uses MoltenVK as XCFramework. - Update documentation. --- .../API-Samples.xcodeproj/project.pbxproj | 42 +-- .../Cube/Cube.xcodeproj/project.pbxproj | 83 +---- .../Hologram.xcodeproj/project.pbxproj | 55 +++- Demos/README.md | 12 +- Docs/MoltenVK_Runtime_UserGuide.md | 291 +++++++++--------- .../project.pbxproj | 8 +- ExternalRevisions/README.md | 2 +- Makefile | 51 ++- MoltenVK/MoltenVK.xcframework | 1 + MoltenVK/MoltenVK.xcodeproj/project.pbxproj | 107 +------ MoltenVK/dylib | 1 + MoltenVK/iOS | 1 - MoltenVK/macOS | 1 - MoltenVK/tvOS | 1 - MoltenVKPackaging.xcodeproj/project.pbxproj | 36 +-- .../MoltenVKGLSLToSPIRVConverter.xcframework | 1 + .../MoltenVKGLSLToSPIRVConverter/iOS | 1 - .../MoltenVKGLSLToSPIRVConverter/macOS | 1 - .../MoltenVKGLSLToSPIRVConverter/tvOS | 1 - .../MoltenVKSPIRVToMSLConverter.xcframework | 1 + .../MoltenVKSPIRVToMSLConverter/iOS | 1 - .../MoltenVKSPIRVToMSLConverter/macOS | 1 - .../MoltenVKSPIRVToMSLConverter/tvOS | 1 - .../project.pbxproj | 12 +- README.md | 51 +-- Scripts/copy_ext_lib_to_staging.sh | 2 +- Scripts/copy_lib_to_staging.sh | 25 +- Scripts/copy_to_staging.sh | 33 +- Scripts/create_fat_ext_libs.sh | 15 - Scripts/create_fat_lib_func.sh | 37 --- Scripts/create_fat_libs.sh | 27 -- Scripts/create_fat_libs_ios.sh | 10 - Scripts/create_fat_libs_tvos.sh | 10 - Scripts/create_framework.sh | 15 - Scripts/create_framework_ios.sh | 9 - Scripts/create_framework_macos.sh | 11 - Scripts/create_framework_tvos.sh | 9 - Scripts/create_xcframework_func.sh | 4 +- Scripts/package_all.sh | 11 - Scripts/package_moltenvk.sh | 45 +-- Scripts/package_one_os.sh | 8 - Scripts/package_shader_converter_tool.sh | 1 + .../iOS/Template.framework/Headers/README | 1 - .../macOS/Template.framework/Headers | 1 - .../Versions/A/Headers/README | 1 - .../macOS/Template.framework/Versions/Current | 1 - Templates/framework/tvOS | 1 - fetchDependencies | 88 ++---- 48 files changed, 411 insertions(+), 717 deletions(-) create mode 120000 MoltenVK/MoltenVK.xcframework create mode 120000 MoltenVK/dylib delete mode 120000 MoltenVK/iOS delete mode 120000 MoltenVK/macOS delete mode 120000 MoltenVK/tvOS create mode 120000 MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter.xcframework delete mode 120000 MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS delete mode 120000 MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS delete mode 120000 MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/tvOS create mode 120000 MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter.xcframework delete mode 120000 MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/iOS delete mode 120000 MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/macOS delete mode 120000 MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/tvOS delete mode 100755 Scripts/create_fat_ext_libs.sh delete mode 100755 Scripts/create_fat_lib_func.sh delete mode 100755 Scripts/create_fat_libs.sh delete mode 100755 Scripts/create_fat_libs_ios.sh delete mode 100755 Scripts/create_fat_libs_tvos.sh delete mode 100755 Scripts/create_framework.sh delete mode 100755 Scripts/create_framework_ios.sh delete mode 100755 Scripts/create_framework_macos.sh delete mode 100755 Scripts/create_framework_tvos.sh delete mode 100755 Scripts/package_one_os.sh delete mode 100644 Templates/framework/iOS/Template.framework/Headers/README delete mode 120000 Templates/framework/macOS/Template.framework/Headers delete mode 100644 Templates/framework/macOS/Template.framework/Versions/A/Headers/README delete mode 120000 Templates/framework/macOS/Template.framework/Versions/Current delete mode 120000 Templates/framework/tvOS diff --git a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj index 7cc7ff1d..a573e925 100644 --- a/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj +++ b/Demos/LunarG-VulkanSamples/API-Samples/API-Samples.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 48; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -27,6 +27,8 @@ A964BD3E1E4EA6FC00CA9AF1 /* util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A964BC611E4EA6FC00CA9AF1 /* util.cpp */; }; A964BD3F1E4EA6FC00CA9AF1 /* util_init.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A964BC631E4EA6FC00CA9AF1 /* util_init.cpp */; }; A964BD401E4EA6FC00CA9AF1 /* util_init.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A964BC631E4EA6FC00CA9AF1 /* util_init.cpp */; }; + A991E26924FCA59600D968D4 /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A991E26824FCA59600D968D4 /* MoltenVK.xcframework */; }; + A991E26A24FCA59600D968D4 /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A991E26824FCA59600D968D4 /* MoltenVK.xcframework */; }; A9B67B781C3AAE9800373FFD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6C1C3AAE9800373FFD /* AppDelegate.m */; }; A9B67B7A1C3AAE9800373FFD /* DemoViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6F1C3AAE9800373FFD /* DemoViewController.mm */; }; A9B67B7C1C3AAE9800373FFD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B711C3AAE9800373FFD /* main.m */; }; @@ -39,10 +41,6 @@ A9B67B8F1C3AAEA200373FFD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B871C3AAEA200373FFD /* main.m */; }; A9B67B901C3AAEA200373FFD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B8A1C3AAEA200373FFD /* Main.storyboard */; }; A9B67B911C3AAEA200373FFD /* macOS.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B8B1C3AAEA200373FFD /* macOS.xcassets */; }; - A9C2ABA2218505B000DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9C2ABA0218505B000DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework */; }; - A9C2ABA3218505B000DDBC03 /* MoltenVK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9C2ABA1218505B000DDBC03 /* MoltenVK.framework */; }; - A9C2ABA6218505CB00DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9C2ABA4218505CB00DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework */; }; - A9C2ABA7218505CB00DDBC03 /* MoltenVK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9C2ABA5218505CB00DDBC03 /* MoltenVK.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -90,6 +88,7 @@ A964BC631E4EA6FC00CA9AF1 /* util_init.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = util_init.cpp; sourceTree = ""; }; A964BC641E4EA6FC00CA9AF1 /* util_init.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = util_init.hpp; sourceTree = ""; }; A977BCFE1B66BB010067E5BF /* API-Samples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "API-Samples.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + A991E26824FCA59600D968D4 /* MoltenVK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoltenVK.xcframework; path = ../../../MoltenVK/MoltenVK.xcframework; sourceTree = ""; }; A99B2F0D24436190001117F7 /* generateSPIRVShaders */ = {isa = PBXFileReference; lastKnownFileType = text; path = generateSPIRVShaders; sourceTree = ""; }; A9B67B6B1C3AAE9800373FFD /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; A9B67B6C1C3AAE9800373FFD /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -111,10 +110,6 @@ A9B67B881C3AAEA200373FFD /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; A9B67B8A1C3AAEA200373FFD /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; A9B67B8B1C3AAEA200373FFD /* macOS.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = macOS.xcassets; sourceTree = ""; }; - A9C2ABA0218505B000DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MoltenVKGLSLToSPIRVConverter.framework; path = ../../../MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS/MoltenVKGLSLToSPIRVConverter.framework; sourceTree = ""; }; - A9C2ABA1218505B000DDBC03 /* MoltenVK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MoltenVK.framework; path = ../../../MoltenVK/iOS/framework/MoltenVK.framework; sourceTree = ""; }; - A9C2ABA4218505CB00DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MoltenVKGLSLToSPIRVConverter.framework; path = ../../../MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS/MoltenVKGLSLToSPIRVConverter.framework; sourceTree = ""; }; - A9C2ABA5218505CB00DDBC03 /* MoltenVK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MoltenVK.framework; path = ../../../MoltenVK/macOS/framework/MoltenVK.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -122,8 +117,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A9C2ABA3218505B000DDBC03 /* MoltenVK.framework in Frameworks */, - A9C2ABA2218505B000DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework in Frameworks */, + A991E26924FCA59600D968D4 /* MoltenVK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -131,8 +125,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A9C2ABA7218505CB00DDBC03 /* MoltenVK.framework in Frameworks */, - A9C2ABA6218505CB00DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework in Frameworks */, + A991E26A24FCA59600D968D4 /* MoltenVK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -496,10 +489,7 @@ A9C2AB9F218505B000DDBC03 /* Frameworks */ = { isa = PBXGroup; children = ( - A9C2ABA5218505CB00DDBC03 /* MoltenVK.framework */, - A9C2ABA4218505CB00DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework */, - A9C2ABA1218505B000DDBC03 /* MoltenVK.framework */, - A9C2ABA0218505B000DDBC03 /* MoltenVKGLSLToSPIRVConverter.framework */, + A991E26824FCA59600D968D4 /* MoltenVK.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -643,10 +633,6 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../MoltenVK/iOS/framework\"", - "\"$(SRCROOT)/../../../MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS/framework\"", - ); GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -670,10 +656,6 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../MoltenVK/iOS/framework\"", - "\"$(SRCROOT)/../../../MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS/framework\"", - ); GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; GCC_WARN_64_TO_32_BIT_CONVERSION = NO; @@ -692,10 +674,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../MoltenVK/macOS/framework\"", - "\"$(SRCROOT)/../../../MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS/framework\"", - ); GCC_PREFIX_HEADER = "$(SRCROOT)/macOS/Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -719,10 +697,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../MoltenVK/macOS/framework\"", - "\"$(SRCROOT)/../../../MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS/framework\"", - ); GCC_PREFIX_HEADER = "$(SRCROOT)/macOS/Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist"; @@ -765,6 +739,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../MoltenVK/include\"", + "\"$(SRCROOT)/../../../MoltenVKShaderConverter/include\"", "\"$(SRCROOT)/../VulkanSamples/API-Samples/utils\"", ); ONLY_ACTIVE_ARCH = YES; @@ -798,6 +773,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( "\"$(SRCROOT)/../../../MoltenVK/include\"", + "\"$(SRCROOT)/../../../MoltenVKShaderConverter/include\"", "\"$(SRCROOT)/../VulkanSamples/API-Samples/utils\"", ); PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.${PRODUCT_NAME:identifier}"; diff --git a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj index 02353401..e8259c95 100644 --- a/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj +++ b/Demos/LunarG-VulkanSamples/Cube/Cube.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 48; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -13,9 +13,10 @@ A93DBF4124A2A4D500079F64 /* DemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6F1C3AAE9800373FFD /* DemoViewController.m */; }; A93DBF4224A2A4D500079F64 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6C1C3AAE9800373FFD /* AppDelegate.m */; }; A93DBF4324A2A4D500079F64 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B711C3AAE9800373FFD /* main.m */; }; - A93DBF4E24A2A6F000079F64 /* libMoltenVK.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A93DBF4D24A2A6F000079F64 /* libMoltenVK.dylib */; }; - A93DBF4F24A2A6F000079F64 /* libMoltenVK.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A93DBF4D24A2A6F000079F64 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; A94D4CB724A2C9A3009C9139 /* MainTV.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A94D4CB624A2C9A3009C9139 /* MainTV.storyboard */; }; + A991E27624FD543A00D968D4 /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A991E27524FD543A00D968D4 /* MoltenVK.xcframework */; }; + A991E27724FD543A00D968D4 /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A991E27524FD543A00D968D4 /* MoltenVK.xcframework */; }; + A991E27824FD543A00D968D4 /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A991E27524FD543A00D968D4 /* MoltenVK.xcframework */; }; A9B53B151C3AC0BE00ABC6F6 /* macOS.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B8B1C3AAEA200373FFD /* macOS.xcassets */; }; A9B53B161C3AC0BE00ABC6F6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B8A1C3AAEA200373FFD /* Main.storyboard */; }; A9B53B181C3AC0BE00ABC6F6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B831C3AAEA200373FFD /* AppDelegate.m */; }; @@ -28,53 +29,16 @@ A9B53B341C3AC15200ABC6F6 /* DemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6F1C3AAE9800373FFD /* DemoViewController.m */; }; A9B53B351C3AC15200ABC6F6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B6C1C3AAE9800373FFD /* AppDelegate.m */; }; A9B53B361C3AC15200ABC6F6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B711C3AAE9800373FFD /* main.m */; }; - A9C2ABAC2185086D00DDBC03 /* libMoltenVK.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A9C2ABAB2185086D00DDBC03 /* libMoltenVK.dylib */; }; - A9C2ABAD2185087500DDBC03 /* libMoltenVK.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A9C2ABA92185085B00DDBC03 /* libMoltenVK.dylib */; }; - A9C2ABB02185098A00DDBC03 /* libMoltenVK.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A9C2ABAB2185086D00DDBC03 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - A9C2ABB12185099500DDBC03 /* libMoltenVK.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A9C2ABA92185085B00DDBC03 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; /* End PBXBuildFile section */ -/* Begin PBXCopyFilesBuildPhase section */ - A91F43A11EDDD48800733D01 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - A9C2ABB02185098A00DDBC03 /* libMoltenVK.dylib in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A93DBF4624A2A4D500079F64 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - A93DBF4F24A2A6F000079F64 /* libMoltenVK.dylib in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A9B2A5571D7E4FC400F66656 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - A9C2ABB12185099500DDBC03 /* libMoltenVK.dylib in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ A904B5301C9A08C90008C013 /* cube.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cube.c; sourceTree = ""; }; A904B5311C9A08C90008C013 /* cube.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = cube.frag; sourceTree = ""; }; A904B5331C9A08C90008C013 /* cube.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = cube.vert; sourceTree = ""; }; A93DBF4B24A2A4D500079F64 /* Cube.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cube.app; sourceTree = BUILT_PRODUCTS_DIR; }; - A93DBF4D24A2A6F000079F64 /* libMoltenVK.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libMoltenVK.dylib; path = ../../../MoltenVK/tvOS/dynamic/libMoltenVK.dylib; sourceTree = ""; }; A94D4CB424A2A95E009C9139 /* InfoTV.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = InfoTV.plist; sourceTree = ""; }; A94D4CB624A2C9A3009C9139 /* MainTV.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = MainTV.storyboard; sourceTree = ""; }; + A991E27524FD543A00D968D4 /* MoltenVK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoltenVK.xcframework; path = ../../../MoltenVK/MoltenVK.xcframework; sourceTree = ""; }; A9B53B271C3AC0BE00ABC6F6 /* Cube.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cube.app; sourceTree = BUILT_PRODUCTS_DIR; }; A9B53B431C3AC15200ABC6F6 /* Cube.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cube.app; sourceTree = BUILT_PRODUCTS_DIR; }; A9B67B6B1C3AAE9800373FFD /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -97,8 +61,6 @@ A9B67B881C3AAEA200373FFD /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; A9B67B8A1C3AAEA200373FFD /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; A9B67B8B1C3AAEA200373FFD /* macOS.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = macOS.xcassets; sourceTree = ""; }; - A9C2ABA92185085B00DDBC03 /* libMoltenVK.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libMoltenVK.dylib; path = ../../../MoltenVK/macOS/dynamic/libMoltenVK.dylib; sourceTree = ""; }; - A9C2ABAB2185086D00DDBC03 /* libMoltenVK.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libMoltenVK.dylib; path = ../../../MoltenVK/iOS/dynamic/libMoltenVK.dylib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -106,7 +68,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A93DBF4E24A2A6F000079F64 /* libMoltenVK.dylib in Frameworks */, + A991E27724FD543A00D968D4 /* MoltenVK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -114,7 +76,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A9C2ABAD2185087500DDBC03 /* libMoltenVK.dylib in Frameworks */, + A991E27824FD543A00D968D4 /* MoltenVK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -122,7 +84,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A9C2ABAC2185086D00DDBC03 /* libMoltenVK.dylib in Frameworks */, + A991E27624FD543A00D968D4 /* MoltenVK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -217,9 +179,7 @@ A9C2ABA82185085B00DDBC03 /* Frameworks */ = { isa = PBXGroup; children = ( - A93DBF4D24A2A6F000079F64 /* libMoltenVK.dylib */, - A9C2ABAB2185086D00DDBC03 /* libMoltenVK.dylib */, - A9C2ABA92185085B00DDBC03 /* libMoltenVK.dylib */, + A991E27524FD543A00D968D4 /* MoltenVK.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -234,7 +194,6 @@ A93DBF3B24A2A4D500079F64 /* Resources */, A93DBF4024A2A4D500079F64 /* Sources */, A93DBF4424A2A4D500079F64 /* Frameworks */, - A93DBF4624A2A4D500079F64 /* CopyFiles */, ); buildRules = ( ); @@ -252,7 +211,6 @@ A9B53B141C3AC0BE00ABC6F6 /* Resources */, A9B53B171C3AC0BE00ABC6F6 /* Sources */, A9B53B1B1C3AC0BE00ABC6F6 /* Frameworks */, - A9B2A5571D7E4FC400F66656 /* CopyFiles */, ); buildRules = ( ); @@ -270,7 +228,6 @@ A9B53B2E1C3AC15200ABC6F6 /* Resources */, A9B53B331C3AC15200ABC6F6 /* Sources */, A9B53B371C3AC15200ABC6F6 /* Frameworks */, - A91F43A11EDDD48800733D01 /* CopyFiles */, ); buildRules = ( ); @@ -391,8 +348,6 @@ MVK_SAMP_CUBE, ); INFOPLIST_FILE = "$(SRCROOT)/iOS/InfoTV.plist"; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/tvOS/dynamic\""; MARKETING_VERSION = 1; PRODUCT_NAME = Cube; SDKROOT = appletvos; @@ -412,8 +367,6 @@ MVK_SAMP_CUBE, ); INFOPLIST_FILE = "$(SRCROOT)/iOS/InfoTV.plist"; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/tvOS/dynamic\""; MARKETING_VERSION = 1; PRODUCT_NAME = Cube; SDKROOT = appletvos; @@ -432,8 +385,6 @@ MVK_SAMP_CUBE, ); INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/macOS/dynamic\""; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = Cube; SDKROOT = macosx; @@ -451,8 +402,6 @@ MVK_SAMP_CUBE, ); INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/macOS/dynamic\""; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = Cube; SDKROOT = macosx; @@ -472,8 +421,6 @@ ); INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/dynamic\""; MARKETING_VERSION = 1; PRODUCT_NAME = Cube; SDKROOT = iphoneos; @@ -494,8 +441,6 @@ ); INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/dynamic\""; MARKETING_VERSION = 1; PRODUCT_NAME = Cube; SDKROOT = iphoneos; @@ -534,7 +479,10 @@ "\"$(SRCROOT)/../../../MoltenVK/include\"", ); ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lstdc++", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.${PRODUCT_NAME:identifier}"; }; name = Debug; @@ -563,7 +511,10 @@ "\"$(SRCROOT)/include\"", "\"$(SRCROOT)/../../../MoltenVK/include\"", ); - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lstdc++", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.${PRODUCT_NAME:identifier}"; }; name = Release; diff --git a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj index a1b2d558..019e6abc 100644 --- a/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj +++ b/Demos/LunarG-VulkanSamples/Hologram/Hologram.xcodeproj/project.pbxproj @@ -7,6 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + A92806E724FD77C00082B2CF /* libMoltenVK.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A991E27124FD520900D968D4 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + A92806E924FD77EC0082B2CF /* libMoltenVK.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A991E27324FD521600D968D4 /* libMoltenVK.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + A991E27224FD520900D968D4 /* libMoltenVK.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A991E27124FD520900D968D4 /* libMoltenVK.dylib */; }; + A991E27424FD521600D968D4 /* libMoltenVK.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A991E27324FD521600D968D4 /* libMoltenVK.dylib */; }; A99789AF1CD3D4E2005E7DAC /* Hologram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A99789831CD3D4E2005E7DAC /* Hologram.cpp */; }; A99789B01CD3D4E2005E7DAC /* Hologram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A99789831CD3D4E2005E7DAC /* Hologram.cpp */; }; A99789B71CD3D4E2005E7DAC /* Main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A99789881CD3D4E2005E7DAC /* Main.cpp */; }; @@ -31,12 +35,33 @@ A9B67B8F1C3AAEA200373FFD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B67B871C3AAEA200373FFD /* main.m */; }; A9B67B901C3AAEA200373FFD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B8A1C3AAEA200373FFD /* Main.storyboard */; }; A9B67B911C3AAEA200373FFD /* macOS.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9B67B8B1C3AAEA200373FFD /* macOS.xcassets */; }; - A9C2AB99218503A400DDBC03 /* libMoltenVK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9C2AB97218503A400DDBC03 /* libMoltenVK.a */; }; - A9C2AB9E218503BA00DDBC03 /* libMoltenVK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9C2AB9C218503BA00DDBC03 /* libMoltenVK.a */; }; A9D516F81CD575E300097D96 /* HelpersDispatchTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D516F61CD575E300097D96 /* HelpersDispatchTable.cpp */; }; A9D516F91CD575E300097D96 /* HelpersDispatchTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D516F61CD575E300097D96 /* HelpersDispatchTable.cpp */; }; /* End PBXBuildFile section */ +/* Begin PBXCopyFilesBuildPhase section */ + A92806E624FD77AA0082B2CF /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + A92806E724FD77C00082B2CF /* libMoltenVK.dylib in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A92806E824FD77D50082B2CF /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + A92806E924FD77EC0082B2CF /* libMoltenVK.dylib in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 1D6058910D05DD3D006BFB54 /* Hologram.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Hologram.app; sourceTree = BUILT_PRODUCTS_DIR; }; A93374642284CD260059D36E /* Hologram.vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Hologram.vert.h; path = android/src/main/jni/Hologram.vert.h; sourceTree = ""; }; @@ -45,6 +70,8 @@ A93CC3701CD56B8F00EB8A56 /* generate-dispatch-table */ = {isa = PBXFileReference; explicitFileType = text.script.python; path = "generate-dispatch-table"; sourceTree = ""; }; A93CC3711CD56FD600EB8A56 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; A977BCFE1B66BB010067E5BF /* Hologram.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Hologram.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A991E27124FD520900D968D4 /* libMoltenVK.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libMoltenVK.dylib; path = ../../../MoltenVK/dylib/iOS/libMoltenVK.dylib; sourceTree = ""; }; + A991E27324FD521600D968D4 /* libMoltenVK.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libMoltenVK.dylib; path = ../../../MoltenVK/dylib/macOS/libMoltenVK.dylib; sourceTree = ""; }; A997897F1CD3D4E2005E7DAC /* Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Game.h; sourceTree = ""; }; A99789821CD3D4E2005E7DAC /* Helpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Helpers.h; sourceTree = ""; }; A99789831CD3D4E2005E7DAC /* Hologram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Hologram.cpp; sourceTree = ""; }; @@ -79,8 +106,6 @@ A9B67B881C3AAEA200373FFD /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; A9B67B8A1C3AAEA200373FFD /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; A9B67B8B1C3AAEA200373FFD /* macOS.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = macOS.xcassets; sourceTree = ""; }; - A9C2AB97218503A400DDBC03 /* libMoltenVK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libMoltenVK.a; path = ../../../MoltenVK/iOS/static/libMoltenVK.a; sourceTree = ""; }; - A9C2AB9C218503BA00DDBC03 /* libMoltenVK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libMoltenVK.a; path = ../../../MoltenVK/macOS/static/libMoltenVK.a; sourceTree = ""; }; A9D516F61CD575E300097D96 /* HelpersDispatchTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HelpersDispatchTable.cpp; sourceTree = ""; }; A9D516F71CD575E300097D96 /* HelpersDispatchTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpersDispatchTable.h; sourceTree = ""; }; /* End PBXFileReference section */ @@ -90,7 +115,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A9C2AB99218503A400DDBC03 /* libMoltenVK.a in Frameworks */, + A991E27224FD520900D968D4 /* libMoltenVK.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -98,7 +123,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A9C2AB9E218503BA00DDBC03 /* libMoltenVK.a in Frameworks */, + A991E27424FD521600D968D4 /* libMoltenVK.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -207,8 +232,8 @@ A9C2AB96218503A400DDBC03 /* Frameworks */ = { isa = PBXGroup; children = ( - A9C2AB9C218503BA00DDBC03 /* libMoltenVK.a */, - A9C2AB97218503A400DDBC03 /* libMoltenVK.a */, + A991E27124FD520900D968D4 /* libMoltenVK.dylib */, + A991E27324FD521600D968D4 /* libMoltenVK.dylib */, ); name = Frameworks; sourceTree = ""; @@ -232,6 +257,7 @@ 1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588E0D05DD3D006BFB54 /* Sources */, 1D60588F0D05DD3D006BFB54 /* Frameworks */, + A92806E624FD77AA0082B2CF /* CopyFiles */, ); buildRules = ( ); @@ -249,6 +275,7 @@ A977BCBE1B66BB010067E5BF /* Resources */, A977BCC91B66BB010067E5BF /* Sources */, A977BCF11B66BB010067E5BF /* Frameworks */, + A92806E824FD77D50082B2CF /* CopyFiles */, ); buildRules = ( ); @@ -358,7 +385,8 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch"; INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/static\""; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/dylib/iOS\""; MARKETING_VERSION = 1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -374,7 +402,8 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch"; INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/iOS/static\""; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/dylib/iOS\""; MARKETING_VERSION = 1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -388,7 +417,8 @@ COMBINE_HIDPI_IMAGES = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/macOS/Prefix.pch"; INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/macOS/static\""; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/dylib/macOS\""; MACOSX_DEPLOYMENT_TARGET = 10.11; OTHER_LDFLAGS = ( "$(inherited)", @@ -405,7 +435,8 @@ COMBINE_HIDPI_IMAGES = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/macOS/Prefix.pch"; INFOPLIST_FILE = "$(SRCROOT)/macOS/Info.plist"; - LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/macOS/static\""; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../MoltenVK/dylib/macOS\""; MACOSX_DEPLOYMENT_TARGET = 10.11; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/Demos/README.md b/Demos/README.md index aeccf91e..0334bb33 100644 --- a/Demos/README.md +++ b/Demos/README.md @@ -56,9 +56,8 @@ In addition to devices, this demo will also run on the `iOS Simulator` or `tvOS The *macOS* version of this demo includes a sizable window, and represents an example of how to detect, within your *Vulkan* code, when a window has been resized, and to modify the *Vulkan* swapchain accordingly. -The `Cube` demo is a simple example of installing **MoltenVK** as a *dynamic library*. In this demo, -the **MoltenVK** *dynamic library* is embedded in the application, but it could have been installed -as a system library instead. +The `Cube` demo is a simple example of installing **MoltenVK** as an `XCFramework` +that is statically linked to the application. @@ -82,7 +81,9 @@ The demo allows some customization, by modifying the arguments passed to the dem To customize, modify the arguments created in the `DemoViewController viewDidLoad` method found in the `iOS/DemoViewController.mm` or `macOS/DemoViewController.mm` file. -The `Hologram` demo is a simple example of installing **MoltenVK** as a *static library*. +The `Hologram` demo is a simple example of installing **MoltenVK** as a *dynamic library* that is +dynamically linked to the application. In this demo, the **MoltenVK** *dynamic library* is copied +into and embedded in the application, but it could have been installed as a system library instead. @@ -119,7 +120,8 @@ follow the instructions in the comments within that file. To see descriptions and screenshots of each of the demos, open [this summary document](LunarG-VulkanSamples/VulkanSamples/samples_index.html#AdditionalVulkan). -The `API-Samples` demo is a simple example of installing **MoltenVK** as a *static framework*. +The `API-Samples` demo is a simple example of installing **MoltenVK** as an `XCFramework` that +is statically linked to the application. diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md index 4ce4d583..2794bc7d 100644 --- a/Docs/MoltenVK_Runtime_UserGuide.md +++ b/Docs/MoltenVK_Runtime_UserGuide.md @@ -20,8 +20,9 @@ Table of Contents - [About This Document](#about_this) - [About **MoltenVK**](#about_moltenvk) - [Installing **MoltenVK** in Your *Vulkan* Application](#install) + - [Install *MoltenVK* as a Universal `XCFramework`](#install_xcfwk) + - [Install *MoltenVK* as a Dynamic Library](#install_dylib) - [Build and Runtime Requirements](#requirements) - - [Install as Static Framework, Static Library, or Dynamic Library](#install_lib) - [Interacting with the **MoltenVK** Runtime](#interaction) - [MoltenVK `VK_MVK_moltenvk` Extension](#moltenvk_extension) - [Configuring MoltenVK](#moltenvk_config) @@ -76,6 +77,144 @@ standard distribution channels, including *Apple's App Store*. Installing **MoltenVK** in Your *Vulkan* Application ---------------------------------------------------- +Installation of **MoltenVK** in your application is straightforward and easy! + +Depending on your build and deployment needs, you can link **MoltenVK** to your application either +as a universal `XCFramework` or as a *dynamic library* (`.dylib`). Distributing an app containing +a dynamic library via the *iOS App Store* or *tvOS App Store* can require specialized bundling. +If you are unsure about which linking and deployment option you need, or on *iOS* or *tvOS*, +unless you have specific needs for dynamic libraries, follow the steps for linking **MoltenVK** +as an `XCFramework`, as it is the simpler option. + +The demo apps, found in the `Demos.xcworkspace`, located in the `Demos` folder, demonstrate both +of the installation techniques discussed above: + +- `XCFramework`: `Cube` and `API-Samples` demos. +- Dynamic library: `Hologram` demo. + + + +### Install *MoltenVK* as a Universal `XCFramework` + +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 + *Project Navigator* panel. + +2. Open the *Build Settings* tab. + + 1. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting, + add an entry that points to the `MoltenVK/include` folder. + + 2. If using `IOSurfaces` on *iOS*, open the **iOS Deployment Target** (aka `IPHONEOS_DEPLOYMENT_TARGET`) + setting, and ensure it is set to a value of `iOS 11.0` or greater, or if using `IOSurfaces` on *tvOS*, + open the **tvOS Deployment Target** (aka `TVOS_DEPLOYMENT_TARGET`) setting, and ensure it is set to a + value of `tvOS 11.0` or greater. + +3. Open the *Build Phases* tab and open the *Link Binary With Libraries* list. + + 1. Drag `MoltenVK/MoltenVK.xcframework` to the *Link Binary With Libraries* list. + + 2. If your application does **_not_** use use `C++`, click the **+** button, + and add `libc++.tbd` by selecting it from the list of system frameworks. + This is needed because **MoltenVK** uses `C++` system libraries internally. + + 3. If you do **_not_** have the **Link Frameworks Automatically** (aka `CLANG_MODULES_AUTOLINK`) and + **Enable Modules (C and Objective-C)** (aka `CLANG_ENABLE_MODULES`) settings enabled, click the + **+** button, and add the following items by selecting them from the list of system frameworks: + - `libc++.tbd` *(if not already done in Step 2)* + - `Metal.framework` + - `Foundation.framework`. + - `QuartzCore.framework` + - `IOKit.framework` (*macOS*) + - `UIKit.framework` (*iOS* or *tvOS*) + - `IOSurface.framework` (*macOS*, or *iOS* if `IPHONEOS_DEPLOYMENT_TARGET` is at least `iOS 11.0`, + or *tvOS* if `TVOS_DEPLOYMENT_TARGET` is at least `tvOS 11.0`) + + + + +### Install *MoltenVK* as a Dynamic Library + +To link **MoltenVK** to your application as a dynamic library (`.dylib`), follow these steps: + +1. Open your application in *Xcode* and select your application's target in the + *Project Navigator* panel. + + +2. Open the *Build Settings* tab. + + 1. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting, + add an entry that points to the `MoltenVK/include` folder. + + 2. In the **Library Search Paths** (aka `LIBRARY_SEARCH_PATHS`) setting, + add an entry that points to **_one_** of the following folders: + - `MoltenVK/dylib/macOS` *(macOS)* + - `MoltenVK/dylib/iOS` *(iOS)* + - `MoltenVK/dylib/tvOS` *(tvOS)* + + 3. In the **Runpath Search Paths** (aka `LD_RUNPATH_SEARCH_PATHS`) setting, + add an entry that matches where the dynamic library will be located in your runtime + environment. If the dynamic library is to be embedded within your application, + you would typically set this to **_one_** of these values: + + - `@executable_path/../Frameworks` *(macOS)* + - `@executable_path/Frameworks` *(iOS or tvOS)* + + The `libMoltenVK.dylib` library is internally configured to be located at + `@rpath/libMoltenVK.dylib`. + + 3. If using `IOSurfaces` on *iOS*, open the **iOS Deployment Target** (aka `IPHONEOS_DEPLOYMENT_TARGET`) + setting, and ensure it is set to a value of `iOS 11.0` or greater, or if using `IOSurfaces` on *tvOS*, + open the **tvOS Deployment Target** (aka `TVOS_DEPLOYMENT_TARGET`) setting, and ensure it is set to a + value of `tvOS 11.0` or greater. + +3. Open the *Build Phases* tab and open the *Link Binary With Libraries* list. + + 1. Drag **_one_** of the following files to the *Link Binary With Libraries* list: + - `MoltenVK/dylib/macOS/libMoltenVK.dylib` *(macOS)* + - `MoltenVK/dylib/iOS/libMoltenVK.dylib` *(iOS)* + - `MoltenVK/dylib/tvOS/libMoltenVK.dylib` *(tvOS)* + + 2. If your application does **_not_** use use `C++`, click the **+** button, + and add `libc++.tbd` by selecting it from the list of system frameworks. + This is needed because **MoltenVK** uses `C++` system libraries internally. + + 3. If you do **_not_** have the **Link Frameworks Automatically** (aka `CLANG_MODULES_AUTOLINK`) and + **Enable Modules (C and Objective-C)** (aka `CLANG_ENABLE_MODULES`) settings enabled, click the + **+** button, and add the following items by selecting them from the list of system frameworks: + - `libc++.tbd` *(if not already done in Step 2)* + - `Metal.framework` + - `Foundation.framework`. + - `QuartzCore.framework` + - `IOKit.framework` (*macOS*) + - `UIKit.framework` (*iOS* or *tvOS*) + - `IOSurface.framework` (*macOS*, or *iOS* if `IPHONEOS_DEPLOYMENT_TARGET` is at least `iOS 11.0`, + or *tvOS* if `TVOS_DEPLOYMENT_TARGET` is at least `tvOS 11.0`) + +4. Arrange to install the `libMoltenVK.dylib` file in your application environment: + + - To copy the `libMoltenVK.dylib` file into your application or component library: + + 1. On the *Build Phases* tab, add a new *Copy Files* build phase. + + 2. Set the *Destination* into which you want to place the `libMoltenVK.dylib` file. + Typically this will be *Frameworks* (and it should match the **Runpath Search Paths** + (aka `LD_RUNPATH_SEARCH_PATHS`) build setting you added above). + + 3. Drag **_one_** of the following files to the *Copy Files* list in this new build phase: + - `MoltenVK/dylib/macOS/libMoltenVK.dylib` *(macOS)* + - `MoltenVK/dylib/iOS/libMoltenVK.dylib` *(iOS)* + - `MoltenVK/dylib/tvOS/libMoltenVK.dylib` *(tvOS)* + + - Alternately, you may create your own installation mechanism to install one of the following + files into a standard *macOS*, *iOS*, or *tvOS* system library folder on the user's device: + - `MoltenVK/dylib/macOS/libMoltenVK.dylib` *(macOS)* + - `MoltenVK/dylib/iOS/libMoltenVK.dylib` *(iOS)* + - `MoltenVK/dylib/tvOS/libMoltenVK.dylib` *(tvOS)* + + + ### Build and Runtime Requirements @@ -97,145 +236,19 @@ devices that support *Metal*, or on the *Xcode* *iOS Simulator* or *tvOS Simulat - Information on *iOS* devices that are compatible with *Metal* can be found in [this article](https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/HardwareGPUInformation/HardwareGPUInformation.html). - - - -### Install as Static Framework, Static Library, or Dynamic Library - -Installation of **MoltenVK** is straightforward and easy! - -Depending on your build and deployment needs, you can install **MoltenVK** as a *static framework*, -*static library*, or *dynamic library*, by following the steps in this section. If you are unsure -about which linking and deployment option you need, follow the steps for installing a -*static framework*, as it is the simplest to install. - ->**_Note:_** Distributing an app containing a dynamic library via the *iOS App Store* or - *tvOS App Store* can require specialized bundling. Unless you have specific needs for - dynamic libraries, the recommended approach on *iOS* or *tvOS* is to link **MoltenVK** - to your app as a static library or framework. - - -1. Open your application in *Xcode* and select your application's target in the - *Project Navigator* panel. - - -2. Open the *Build Settings* tab. - - - If installing **MoltenVK** as a *static framework* in your application: - 1. In the **Framework Search Paths** (aka `FRAMEWORK_SEARCH_PATHS`) - setting, add an entry that points to **_one_** of the following folders: - - `MoltenVK/macOS/framework` *(macOS)* - - `MoltenVK/iOS/framework` *(iOS)* - - `MoltenVK/tvOS/framework` *(tvOS)* - - - If installing **MoltenVK** as a *static library* in your application: - 1. In the **Library Search Paths** (aka `LIBRARY_SEARCH_PATHS`) setting, - add an entry that points to **_one_** of the following folders: - - `MoltenVK/macOS/static` *(macOS)* - - `MoltenVK/iOS/static` *(iOS)* - - `MoltenVK/tvOS/static` *(tvOS)* - - 2. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting, - add an entry that points to the `MoltenVK/include` folder. - - - If installing **MoltenVK** as a *dynamic library* in your application: - 1. In the **Library Search Paths** (aka `LIBRARY_SEARCH_PATHS`) setting, - add an entry that points to **_one_** of the following folders: - - `MoltenVK/macOS/dynamic` *(macOS)* - - `MoltenVK/iOS/dynamic` *(iOS)* - - `MoltenVK/tvOS/dynamic` *(tvOS)* - - 2. In the **Header Search Paths** (aka `HEADER_SEARCH_PATHS`) setting, - add an entry that points to the `MoltenVK/include` folder. - 3. In the **Runpath Search Paths** (aka `LD_RUNPATH_SEARCH_PATHS`) setting, - add an entry that matches where the dynamic library will be located in your runtime - environment. If the dynamic library is to be embedded within your application, - you would typically set this value to either: - - - `@executable_path/../Frameworks` *(macOS)* - - `@executable_path/Frameworks` *(iOS or tvOS)* - - The `libMoltenVK.dylib` library is internally configured to be located at - `@rpath/libMoltenVK.dylib`. - -3. With the *Build Settings* tab open, if using `IOSurfaces` on *iOS*, open the **iOS Deployment Target** - (aka `IPHONEOS_DEPLOYMENT_TARGET`) setting, and ensure it is set to a value of `iOS 11.0` or greater, - or if using `IOSurfaces` on *tvOS*, open the **tvOS Deployment Target** (aka `TVOS_DEPLOYMENT_TARGET`) - setting, and ensure it is set to a value of `tvOS 11.0` or greater. - -4. On the *Build Phases* tab, open the *Link Binary With Libraries* list. +When a *Metal* app is running from *Xcode*, the default ***Scheme*** settings may reduce performance. +To improve performance and gain the benefits of *Metal*, perform the following in *Xcode*: - - For *macOS*, drag **_one_** of the following files to the *Link Binary With Libraries* list: - - `MoltenVK/macOS/framework/MoltenVK.framework ` *(static framework)* - - `MoltenVK/macOS/static/libMoltenVK.a` *(static library)* - - `MoltenVK/macOS/dynamic/libMoltenVK.dylib` *(dynamic library)* - - - For *iOS*, drag **_one_** of the following files to the *Link Binary With Libraries* list: - - `MoltenVK/iOS/framework/MoltenVK.framework ` *(static framework)* - - `MoltenVK/iOS/static/libMoltenVK.a` *(static library)* - - `MoltenVK/iOS/dynamic/libMoltenVK.dylib` *(dynamic library)* - - - For *tvOS*, drag **_one_** of the following files to the *Link Binary With Libraries* list: - - `MoltenVK/tvOS/framework/MoltenVK.framework ` *(static framework)* - - `MoltenVK/tvOS/static/libMoltenVK.a` *(static library)* - - `MoltenVK/tvOS/dynamic/libMoltenVK.dylib` *(dynamic library)* - -5. While in the *Link Binary With Libraries* list on the *Build Phases* tab, if you do **_not_** - have the **Link Frameworks Automatically** (aka `CLANG_MODULES_AUTOLINK`) and - **Enable Modules (C and Objective-C)** (aka `CLANG_ENABLE_MODULES`) settings enabled, click - the **+** button, and (selecting from the list of system frameworks) add the following items: - - `libc++.tbd` - - `Metal.framework` - - `Foundation.framework`. - - `QuartzCore.framework` - - `IOKit.framework` (*macOS*) - - `UIKit.framework` (*iOS* or *tvOS*) - - `IOSurface.framework` (*macOS*, or *iOS* if `IPHONEOS_DEPLOYMENT_TARGET` is at least `iOS 11.0`, - or *tvOS* if `TVOS_DEPLOYMENT_TARGET` is at least `tvOS 11.0`) - -6. If installing **MoltenVK** as a *dynamic library* in your application, arrange to install - the `libMoltenVK.dylib` file in your application environment: - - - To copy the `libMoltenVK.dylib` file into your application or component library: - - 1. On the *Build Phases* tab, add a new *Copy Files* build phase. - - 2. Set the *Destination* into which you want to place the `libMoltenVK.dylib` file. - Typically this will be *Frameworks* (and should match the **Runpath Search Paths** - (aka `LD_RUNPATH_SEARCH_PATHS`) build setting you set above). - - 3. Drag **_one_** of the following files to the *Copy Files* list in this new build phase: - - `MoltenVK/macOS/dynamic/libMoltenVK.dylib` *(macOS)* - - `MoltenVK/iOS/dynamic/libMoltenVK.dylib` *(iOS)* - - `MoltenVK/tvOS/dynamic/libMoltenVK.dylib` *(tvOS)* - - - Alternately, you may create your own installation mechanism to install one of the - `MoltenVK/macOS/dynamic/libMoltenVK.dylib`, `MoltenVK/iOS/dynamic/libMoltenVK.dylib`, - or `MoltenVK/tvOS/dynamic/libMoltenVK.dylib` file into a standard *macOS*, *iOS*, or - *tvOS* system library folder on the user's device. - -7. When a *Metal* app is running from *Xcode*, the default ***Scheme*** settings reduce - performance. To improve performance and gain the benefits of *Metal*, perform the - following in *Xcode*: - - 1. Open the ***Scheme Editor*** for building your main application. You can do - this by selecting ***Edit Scheme...*** from the ***Scheme*** drop-down menu, or select - ***Product -> Scheme -> Edit Scheme...*** from the main menu. - 2. On the ***Info*** tab, set the ***Build Configuration*** to ***Release***, and disable the - ***Debug executable*** check-box. - 3. On the ***Options*** tab, disable both the ***Metal API Validation*** and ***GPU Frame Capture*** - options. For optimal performance, you may also consider disabling the other simulation - and debugging options on this tab. For further information, see the - [Xcode Scheme Settings and Performance](https://developer.apple.com/library/ios/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Dev-Technique/Dev-Technique.html#//apple_ref/doc/uid/TP40014221-CH8-SW3) - section of Apple's *Metal Programming Guide* documentation. - - -The demo apps, found in the `Demos.xcworkspace`, located in the `Demos` folder, demonstrate each -of the installation techniques discussed above: - -- Static Framework: `API-Samples`. -- Static library: `Hologram`. -- Dynamic library: `Cube`. +1. Open the ***Scheme Editor*** for building your main application. You can do + this by selecting ***Edit Scheme...*** from the ***Scheme*** drop-down menu, or select + ***Product -> Scheme -> Edit Scheme...*** from the main menu. +2. On the ***Info*** tab, set the ***Build Configuration*** to ***Release***, and disable the + ***Debug executable*** check-box. +3. On the ***Options*** tab, disable both the ***Metal API Validation*** and ***GPU Frame Capture*** + options. For optimal performance, you may also consider disabling the other simulation + and debugging options on this tab. For further information, see the + [Xcode Scheme Settings and Performance](https://developer.apple.com/library/ios/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Dev-Technique/Dev-Technique.html#//apple_ref/doc/uid/TP40014221-CH8-SW3) + section of Apple's *Metal Programming Guide* documentation. diff --git a/ExternalDependencies.xcodeproj/project.pbxproj b/ExternalDependencies.xcodeproj/project.pbxproj index 394c2abe..71f4424a 100644 --- a/ExternalDependencies.xcodeproj/project.pbxproj +++ b/ExternalDependencies.xcodeproj/project.pbxproj @@ -1724,11 +1724,8 @@ A913F24424CF87AE006CB02F /* ShaderLang.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShaderLang.h; sourceTree = ""; }; A913F25724CF87AE006CB02F /* CodeGen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeGen.cpp; sourceTree = ""; }; A913F25824CF87AE006CB02F /* Link.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Link.cpp; sourceTree = ""; }; - A9194DE624E77A2E00FB127B /* copy_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_to_staging.sh; sourceTree = ""; }; A9194DF424E8940600FB127B /* copy_ext_lib_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_ext_lib_to_staging.sh; sourceTree = ""; }; A9194DF524E8979100FB127B /* create_ext_lib_xcframeworks.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_ext_lib_xcframeworks.sh; sourceTree = ""; }; - A932E9C5249A743B00D64150 /* create_fat_lib_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_lib_func.sh; sourceTree = ""; }; - A932E9DF249BC44D00D64150 /* create_fat_ext_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_ext_libs.sh; sourceTree = ""; }; A9415EF624366B0E00566F16 /* packagePregenSpirvToolsHeaders */ = {isa = PBXFileReference; lastKnownFileType = text; path = packagePregenSpirvToolsHeaders; sourceTree = ""; }; A95D90FE23A7F1E500CBCC60 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; A95D90FF23A7F1E500CBCC60 /* InitializeDll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitializeDll.h; sourceTree = ""; }; @@ -2177,6 +2174,7 @@ A9765DEE2485758500FDD115 /* validation_state.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = validation_state.cpp; sourceTree = ""; }; A9765DEF2485758500FDD115 /* validate_primitives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = validate_primitives.cpp; sourceTree = ""; }; A9765DF02485758500FDD115 /* decoration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decoration.h; sourceTree = ""; }; + A9772CFF24F9930E002617D0 /* copy_lib_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_lib_to_staging.sh; sourceTree = ""; }; A991DB2124E6016E00AEEC36 /* create_xcframework_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_xcframework_func.sh; sourceTree = ""; }; A9C2104521D14FD7006BA2D3 /* fetchDependencies */ = {isa = PBXFileReference; lastKnownFileType = text; path = fetchDependencies; sourceTree = ""; }; A9C2104721D15843006BA2D3 /* ExternalRevisions */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ExternalRevisions; sourceTree = ""; }; @@ -2381,10 +2379,8 @@ isa = PBXGroup; children = ( A9194DF424E8940600FB127B /* copy_ext_lib_to_staging.sh */, - A9194DE624E77A2E00FB127B /* copy_to_staging.sh */, + A9772CFF24F9930E002617D0 /* copy_lib_to_staging.sh */, A9194DF524E8979100FB127B /* create_ext_lib_xcframeworks.sh */, - A932E9DF249BC44D00D64150 /* create_fat_ext_libs.sh */, - A932E9C5249A743B00D64150 /* create_fat_lib_func.sh */, A991DB2124E6016E00AEEC36 /* create_xcframework_func.sh */, A9FC5F7F249DA96D003CB086 /* package_ext_libs_finish.sh */, A9415EF624366B0E00566F16 /* packagePregenSpirvToolsHeaders */, diff --git a/ExternalRevisions/README.md b/ExternalRevisions/README.md index cbf5c1c3..8a52555b 100644 --- a/ExternalRevisions/README.md +++ b/ExternalRevisions/README.md @@ -43,7 +43,7 @@ These external open-source libraries are maintained in the `External` directory. To retrieve and build these libraries from their sources, run the `fetchDependencies` script in the main repository directory: - ./fetchDependencies [--debug] + ./fetchDependencies --all [--debug] The `--debug` option will build the external libraries in Debug mode, which may be useful when debugging and tracing calls into those libraries. diff --git a/Makefile b/Makefile index 82fbd535..b2c8406d 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,19 @@ XC_SCHEME := MoltenVK Package # Specify individually (not as dependencies) so the sub-targets don't run in parallel .PHONY: all all: - @$(MAKE) iosfat - @$(MAKE) tvosfat @$(MAKE) macos + @$(MAKE) ios + @$(MAKE) iossim + @$(MAKE) tvos + @$(MAKE) tvossim .PHONY: all-debug all-debug: - @$(MAKE) iosfat-debug - @$(MAKE) tvosfat-debug @$(MAKE) macos-debug + @$(MAKE) ios-debug + @$(MAKE) iossim-debug + @$(MAKE) tvos-debug + @$(MAKE) tvossim-debug .PHONY: macos macos: @@ -30,12 +34,12 @@ ios: ios-debug: xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -configuration "Debug" -.PHONY: iosfat -iosfat: ios +.PHONY: iossim +iossim: xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS Simulator" -.PHONY: iosfat-debug -iosfat-debug: ios-debug +.PHONY: iossim-debug +iossim-debug: xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS Simulator" -configuration "Debug" .PHONY: tvos @@ -46,12 +50,12 @@ tvos: tvos-debug: xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -configuration "Debug" -.PHONY: tvosfat -tvosfat: tvos +.PHONY: tvossim +tvossim: xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS Simulator" -.PHONY: tvosfat-debug -tvosfat-debug: tvos-debug +.PHONY: tvossim-debug +tvossim-debug: xcodebuild build -quiet -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS Simulator" -configuration "Debug" .PHONY: clean @@ -63,5 +67,26 @@ clean: .PHONY: install install: rm -rf /Library/Frameworks/MoltenVK.framework - cp -a Package/Latest/MoltenVK/macOS/framework/MoltenVK.framework /Library/Frameworks/ + rm -rf /Library/Frameworks/MoltenVK.xcframework + cp -a Package/Latest/MoltenVK/MoltenVK.xcframework /Library/Frameworks/ +# Deprecated target names +.PHONY: iosfat +iosfat: + @$(MAKE) ios + @$(MAKE) iossim + +.PHONY: iosfat-debug +iosfat-debug: + @$(MAKE) ios-debug + @$(MAKE) iossim-debug + +.PHONY: tvosfat +tvosfat: + @$(MAKE) tvos + @$(MAKE) tvossim + +.PHONY: tvosfat-debug +tvosfat-debug: + @$(MAKE) tvos-debug + @$(MAKE) tvossim-debug diff --git a/MoltenVK/MoltenVK.xcframework b/MoltenVK/MoltenVK.xcframework new file mode 120000 index 00000000..a3abb4a8 --- /dev/null +++ b/MoltenVK/MoltenVK.xcframework @@ -0,0 +1 @@ +../Package/Latest/MoltenVK/MoltenVK.xcframework \ No newline at end of file diff --git a/MoltenVK/MoltenVK.xcodeproj/project.pbxproj b/MoltenVK/MoltenVK.xcodeproj/project.pbxproj index ce251672..5eb205f6 100644 --- a/MoltenVK/MoltenVK.xcodeproj/project.pbxproj +++ b/MoltenVK/MoltenVK.xcodeproj/project.pbxproj @@ -1040,10 +1040,8 @@ A980A25D24C6288D007A8F6F /* Generate Version Header */, 2FEA0A4024902F9F00EEF3AD /* Headers */, 2FEA0A8224902F9F00EEF3AD /* Sources */, - 2FEA0AB524902F9F00EEF3AD /* Create Dynamic Library */, - A9FC5F6D249D39F3003CB086 /* Create Fat Libraries */, - 2FEA0AB624902F9F00EEF3AD /* Create Framework */, A9CBBFF124F89F79006D41EF /* Copy to Staging */, + 2FEA0AB524902F9F00EEF3AD /* Create Dynamic Library */, ); buildRules = ( ); @@ -1063,10 +1061,8 @@ A980A25B24C6283D007A8F6F /* Generate Version Header */, A9B8EE071A98D796009C5A02 /* Headers */, A9B8EE051A98D796009C5A02 /* Sources */, - A9731FAD1EDDAE39006B7298 /* Create Dynamic Library */, - A9EE084F249BD4AE00E523A2 /* Create Fat Libraries */, - A92EF79721854B3300C8B91B /* Create Framework */, A9CBBFEF24F89F5F006D41EF /* Copy to Staging */, + A9731FAD1EDDAE39006B7298 /* Create Dynamic Library */, ); buildRules = ( ); @@ -1086,9 +1082,8 @@ A980A25E24C62895007A8F6F /* Generate Version Header */, A9CBED871B6299D800E45FDC /* Headers */, A9CBEDCE1B6299D800E45FDC /* Sources */, - A93F47C91D7E389E002AF700 /* Create Dynamic Library */, - A92EF78D21852B2400C8B91B /* Create Framework */, A9CBBFF224F89F87006D41EF /* Copy to Staging */, + A93F47C91D7E389E002AF700 /* Create Dynamic Library */, ); buildRules = ( ); @@ -1212,60 +1207,6 @@ shellPath = /bin/sh; shellScript = ". \"${SRCROOT}/../Scripts/create_dylib_tvos.sh\"\n"; }; - 2FEA0AB624902F9F00EEF3AD /* Create Framework */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Create Framework"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_framework_tvos.sh\"\n"; - }; - A92EF78D21852B2400C8B91B /* Create Framework */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Create Framework"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_framework_macos.sh\"\n"; - }; - A92EF79721854B3300C8B91B /* Create Framework */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Create Framework"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_framework_ios.sh\"\n"; - }; A93F47C91D7E389E002AF700 /* Create Dynamic Library */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1364,7 +1305,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; }; A9CBBFF124F89F79006D41EF /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -1382,7 +1323,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; }; A9CBBFF224F89F87006D41EF /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -1400,43 +1341,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n\n"; - }; - A9EE084F249BD4AE00E523A2 /* Create Fat Libraries */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Create Fat Libraries"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_fat_libs_ios.sh\"\n"; - }; - A9FC5F6D249D39F3003CB086 /* Create Fat Libraries */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Create Fat Libraries"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/create_fat_libs_tvos.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/MoltenVK/dylib b/MoltenVK/dylib new file mode 120000 index 00000000..d7bc57e8 --- /dev/null +++ b/MoltenVK/dylib @@ -0,0 +1 @@ +../Package/Latest/MoltenVK/dylib \ No newline at end of file diff --git a/MoltenVK/iOS b/MoltenVK/iOS deleted file mode 120000 index fcdc7b48..00000000 --- a/MoltenVK/iOS +++ /dev/null @@ -1 +0,0 @@ -../Package/Latest/MoltenVK/iOS \ No newline at end of file diff --git a/MoltenVK/macOS b/MoltenVK/macOS deleted file mode 120000 index c83d7e98..00000000 --- a/MoltenVK/macOS +++ /dev/null @@ -1 +0,0 @@ -../Package/Latest/MoltenVK/macOS \ No newline at end of file diff --git a/MoltenVK/tvOS b/MoltenVK/tvOS deleted file mode 120000 index 5b0bd8ee..00000000 --- a/MoltenVK/tvOS +++ /dev/null @@ -1 +0,0 @@ -../Package/Latest/MoltenVK/tvOS \ No newline at end of file diff --git a/MoltenVKPackaging.xcodeproj/project.pbxproj b/MoltenVKPackaging.xcodeproj/project.pbxproj index 62f8485d..13028ecb 100644 --- a/MoltenVKPackaging.xcodeproj/project.pbxproj +++ b/MoltenVKPackaging.xcodeproj/project.pbxproj @@ -221,28 +221,19 @@ A92EF7CA21856EA200C8B91B /* package_update_latest.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_update_latest.sh; sourceTree = ""; }; A92EF7CB21856EA300C8B91B /* package_shader_converter_xcframework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_shader_converter_xcframework.sh; sourceTree = ""; }; A92EF7DE2186451700C8B91B /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = ../Makefile; sourceTree = ""; }; - A93ED4DE24F59CDB00FEB018 /* copy_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_to_staging.sh; sourceTree = ""; }; - A93ED4E324F59CDB00FEB018 /* copy_lib_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_lib_to_staging.sh; sourceTree = ""; }; - A941E2B1221AEBD000890C56 /* create_framework_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_framework_ios.sh; sourceTree = ""; }; - A941E2B2221AEBD000890C56 /* create_framework_macos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_framework_macos.sh; sourceTree = ""; }; + A93ED4DE24F59CDB00FEB018 /* copy_lib_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_lib_to_staging.sh; sourceTree = ""; }; + A93ED4E324F59CDB00FEB018 /* copy_to_staging.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = copy_to_staging.sh; sourceTree = ""; }; A975D55C213F25D700D4834F /* create_dylib.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib.sh; sourceTree = ""; }; A980A25F24C628F3007A8F6F /* gen_moltenvk_rev_hdr.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = gen_moltenvk_rev_hdr.sh; sourceTree = ""; }; A98149E51FB78829005F00B4 /* MoltenVK_Runtime_UserGuide.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = MoltenVK_Runtime_UserGuide.md; path = Docs/MoltenVK_Runtime_UserGuide.md; sourceTree = ""; }; - A99A760321852584000A8E2A /* create_framework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_framework.sh; sourceTree = ""; }; A9B1007A24F837AF00EADC6E /* create_xcframework_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_xcframework_func.sh; sourceTree = ""; }; - A9B1008924F84EC800EADC6E /* package_one_os.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_one_os.sh; sourceTree = ""; }; A9C70F41221B04C800FBA31A /* create_dylib_macos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_macos.sh; sourceTree = ""; }; A9C70F45221B04C800FBA31A /* create_dylib_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_ios.sh; sourceTree = ""; }; A9CBBFF924F8A1EB006D41EF /* package_moltenvk_xcframework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_moltenvk_xcframework.sh; sourceTree = ""; }; A9DA8340218A198C002AA662 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = ""; }; A9DA8341218A198C002AA662 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; - A9EE084A249BD49200E523A2 /* create_fat_lib_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_lib_func.sh; sourceTree = ""; }; - A9EE084E249BD49200E523A2 /* create_fat_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs.sh; sourceTree = ""; }; - A9EE0851249BD71C00E523A2 /* create_fat_libs_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs_ios.sh; sourceTree = ""; }; A9FC5F60249D2ED3003CB086 /* package_all.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = package_all.sh; sourceTree = ""; }; A9FC5F64249D3778003CB086 /* create_dylib_tvos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_tvos.sh; sourceTree = ""; }; - A9FC5F69249D3843003CB086 /* create_framework_tvos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_framework_tvos.sh; sourceTree = ""; }; - A9FC5F6A249D38DF003CB086 /* create_fat_libs_tvos.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs_tvos.sh; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXGroup section */ @@ -281,27 +272,18 @@ A975D55B213F25AD00D4834F /* Scripts */ = { isa = PBXGroup; children = ( - A93ED4E324F59CDB00FEB018 /* copy_lib_to_staging.sh */, - A93ED4DE24F59CDB00FEB018 /* copy_to_staging.sh */, + A93ED4E324F59CDB00FEB018 /* copy_to_staging.sh */, + A93ED4DE24F59CDB00FEB018 /* copy_lib_to_staging.sh */, A9C70F45221B04C800FBA31A /* create_dylib_ios.sh */, A9C70F41221B04C800FBA31A /* create_dylib_macos.sh */, A9FC5F64249D3778003CB086 /* create_dylib_tvos.sh */, A975D55C213F25D700D4834F /* create_dylib.sh */, - A9EE084A249BD49200E523A2 /* create_fat_lib_func.sh */, - A9EE0851249BD71C00E523A2 /* create_fat_libs_ios.sh */, - A9FC5F6A249D38DF003CB086 /* create_fat_libs_tvos.sh */, - A9EE084E249BD49200E523A2 /* create_fat_libs.sh */, - A941E2B1221AEBD000890C56 /* create_framework_ios.sh */, - A941E2B2221AEBD000890C56 /* create_framework_macos.sh */, - A9FC5F69249D3843003CB086 /* create_framework_tvos.sh */, - A99A760321852584000A8E2A /* create_framework.sh */, A9B1007A24F837AF00EADC6E /* create_xcframework_func.sh */, A980A25F24C628F3007A8F6F /* gen_moltenvk_rev_hdr.sh */, A9FC5F60249D2ED3003CB086 /* package_all.sh */, A92EF7C921856EA200C8B91B /* package_docs.sh */, A9CBBFF924F8A1EB006D41EF /* package_moltenvk_xcframework.sh */, A92EF7C621856EA200C8B91B /* package_moltenvk.sh */, - A9B1008924F84EC800EADC6E /* package_one_os.sh */, A92EF7C721856EA200C8B91B /* package_shader_converter_tool.sh */, A92EF7CB21856EA300C8B91B /* package_shader_converter_xcframework.sh */, A92EF7CA21856EA200C8B91B /* package_update_latest.sh */, @@ -463,7 +445,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export MVK_OS=\"tvOS\"\nexport MVK_BUILT_PROD_DIR=\"${BUILT_PRODUCTS_DIR}-${MVK_OS}\"\n\n. \"${SRCROOT}/Scripts/package_one_os.sh\"\n"; + shellScript = ". \"${SRCROOT}/Scripts/package_all.sh\"\n"; }; A975D5872140585200D4834F /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; @@ -477,7 +459,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export MVK_OS=\"iOS\"\nexport MVK_BUILT_PROD_DIR=\"${BUILT_PRODUCTS_DIR}-${MVK_OS}\"\n\n. \"${SRCROOT}/Scripts/package_one_os.sh\"\n"; + shellScript = ". \"${SRCROOT}/Scripts/package_all.sh\"\n"; }; A975D59A2140586700D4834F /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; @@ -491,7 +473,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export MVK_OS=\"macOS\"\nexport MVK_BUILT_PROD_DIR=\"${BUILT_PRODUCTS_DIR}\"\n\n. \"${SRCROOT}/Scripts/package_one_os.sh\"\n. \"${SRCROOT}/Scripts/package_shader_converter_tool.sh\"\n"; + shellScript = ". \"${SRCROOT}/Scripts/package_all.sh\"\n. \"${SRCROOT}/Scripts/package_shader_converter_tool.sh\"\n"; }; A9AD70122440ED3B00B9E254 /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; @@ -505,7 +487,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export MVK_BUILT_PROD_DIR=\"${BUILT_PRODUCTS_DIR}\"\n. \"${SRCROOT}/Scripts/package_shader_converter_tool.sh\"\n. \"${SRCROOT}/Scripts/package_update_latest.sh\"\n"; + shellScript = ". \"${SRCROOT}/Scripts/package_shader_converter_tool.sh\"\n. \"${SRCROOT}/Scripts/package_update_latest.sh\"\n"; }; A9B1008824F84BE400EADC6E /* Package MoltenVK */ = { isa = PBXShellScriptBuildPhase; @@ -523,7 +505,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/Scripts/package_all.sh\"\n\n"; + shellScript = ". \"${SRCROOT}/Scripts/package_all.sh\"\n. \"${SRCROOT}/Scripts/package_shader_converter_tool.sh\"\n\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter.xcframework b/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter.xcframework new file mode 120000 index 00000000..cf42e4b1 --- /dev/null +++ b/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter.xcframework @@ -0,0 +1 @@ +../Package/Latest/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter.xcframework \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS b/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS deleted file mode 120000 index 4a4b357e..00000000 --- a/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS +++ /dev/null @@ -1 +0,0 @@ -../../Package/Latest/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS b/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS deleted file mode 120000 index ffa407be..00000000 --- a/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS +++ /dev/null @@ -1 +0,0 @@ -../../Package/Latest/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/tvOS b/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/tvOS deleted file mode 120000 index 15a8980c..00000000 --- a/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/tvOS +++ /dev/null @@ -1 +0,0 @@ -../../Package/Latest/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/tvOS \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter.xcframework b/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter.xcframework new file mode 120000 index 00000000..1ba785f0 --- /dev/null +++ b/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter.xcframework @@ -0,0 +1 @@ +../Package/Latest/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter.xcframework \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/iOS b/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/iOS deleted file mode 120000 index 4a4b357e..00000000 --- a/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/iOS +++ /dev/null @@ -1 +0,0 @@ -../../Package/Latest/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/iOS \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/macOS b/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/macOS deleted file mode 120000 index ffa407be..00000000 --- a/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/macOS +++ /dev/null @@ -1 +0,0 @@ -../../Package/Latest/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/macOS \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/tvOS b/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/tvOS deleted file mode 120000 index 15a8980c..00000000 --- a/MoltenVKShaderConverter/MoltenVKSPIRVToMSLConverter/tvOS +++ /dev/null @@ -1 +0,0 @@ -../../Package/Latest/MoltenVKShaderConverter/MoltenVKGLSLToSPIRVConverter/tvOS \ No newline at end of file diff --git a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj index c6d28ee0..d6f3bf6e 100644 --- a/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj +++ b/MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj @@ -576,7 +576,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; }; A93ED4E524F59DEA00FEB018 /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -594,7 +594,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; }; A93ED4E624F59DFB00FEB018 /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -612,7 +612,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; }; A93ED4E724F59E0900FEB018 /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -630,7 +630,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; }; A93ED4E824F59E1100FEB018 /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -648,7 +648,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; }; A93ED4E924F59E1800FEB018 /* Copy to Staging */ = { isa = PBXShellScriptBuildPhase; @@ -666,7 +666,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ". \"${SRCROOT}/../Scripts/copy_lib_to_staging.sh\"\n"; + shellScript = ". \"${SRCROOT}/../Scripts/copy_to_staging.sh\"\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/README.md b/README.md index b460cde9..04c6ccb1 100644 --- a/README.md +++ b/README.md @@ -80,11 +80,10 @@ The **MoltenVK** runtime package contains two products: - **MoltenVKShaderConverter** converts *SPIR-V* shader code to *Metal Shading Language (MSL)* shader code, and converts *GLSL* shader source code to *SPIR-V* shader code and/or - *Metal Shading Language (MSL)* shader code. The *SPIR-V* portion of the converter is also - embedded in the **MoltenVK** runtime to automatically convert *SPIR-V* shaders to their *MSL* - equivalents. In addition, both the *SPIR-V* and *GLSL* converters are packaged into a - stand-alone command-line `MoltenVKShaderConverter` *macOS* tool for converting shaders - at development time from the command line. + *Metal Shading Language (MSL)* shader code. The converter is embedded in the **MoltenVK** + runtime to automatically convert *SPIR-V* shaders to their *MSL* equivalents. In addition, + both the *SPIR-V* and *GLSL* converters are packaged into a stand-alone command-line + `MoltenVKShaderConverter` *macOS* tool for converting shaders at development time from the command line. @@ -117,14 +116,23 @@ on which **MoltenVK** relies: When running the `fetchDependencies` script, you must specify one or more platforms for which to build the external libraries. The platform choices include: - --all --macos --ios --iosfat --tvos --tvosfat + --all + --macos + --ios + --iossim + --tvos + --tvossim -You can specify multiple of these selections. The `--iosfat` and `--tvosfat` selection builds one -binary for each external library, with each binary including code for both *iOS* and *iOS Simulator* -platforms, or *tvOS* and *tvOS Simulator* platforms, respectively. The `--all` selection is the same -as selecting `--macos --iosfat --tvosfat` and results in three binaries for each external library: -a *macOS* binary, a *fat iOS* binary, and a *fat tvOS* binary. The more selections you include, -the longer the build time. +You can specify multiple of these selections. The result is a single `XCFramework` +for each external dependency library, with each `XCFramework` containing binaries for +each of the requested platforms. + +The `--all` selection is the same as entering all of the other platform choices, +and will result in a single `XCFramework` for each external dependency library, +with each `XCFramework` containing binaries for all supported platforms and simulators. + +Running `fetchDependencies` repeatedly with different platforms will accumulate +targets in the `XCFramework`. For more information about the external open-source libraries used by **MoltenVK**, see the [`ExternalRevisions/README.md`](ExternalRevisions/README.md) document. @@ -196,29 +204,28 @@ from the command line. The following `make` targets are provided: make all make macos make ios - make iosfat + make iossim make tvos - make tvosfat + make tvossim make all-debug make macos-debug make ios-debug - make iosfat-debug + make iossim-debug make tvos-debug - make tvosfat-debug + make tvossim-debug make clean make install +- Running `make` repeatedly with different targets will accumulate binaries for these different targets. +- The `all` target executes all platform targets. - The `all` target is the default target. Running `make` with no arguments is the same as running `make all`. -- The `*fat*` targets build fat binaries containing both platform and simulator code. - The `*-debug` targets build the binaries using the **_Debug_** configuration. -- The `all` target executes the `macos`, `iosfat`, and `tvosfat` targets. -- The `all-debug` target executes the `macos-debug`, `iosfat-debug`, and `tvosfat-debug` targets. -- The `install` target will copy the most recently built *macOS* `MoltenVK.framework` into - the `/Library/Frameworks` folder of your computer. Since `/Library/Frameworks` is protected, +- The `install` target will copy the most recently built `MoltenVK.xcframework` into the + `/Library/Frameworks` folder of your computer. Since `/Library/Frameworks` is protected, you will generally need to run it as `sudo make install` and enter your password. - The `install` target just installs the built framework, it does not first build the framework. + The `install` target just installs the built framework, it does not first build the framework. You will first need to at least run `make macos` first. The `make` targets all require that *Xcode* is installed on your system. diff --git a/Scripts/copy_ext_lib_to_staging.sh b/Scripts/copy_ext_lib_to_staging.sh index a2dbe9d6..77ec865f 100755 --- a/Scripts/copy_ext_lib_to_staging.sh +++ b/Scripts/copy_ext_lib_to_staging.sh @@ -1,4 +1,4 @@ #!/bin/bash export MVK_XCFWK_STAGING_DIR="${PROJECT_DIR}/External/build/Intermediates/XCFrameworkStaging/${CONFIGURATION}" -. "${SRCROOT}/Scripts/copy_to_staging.sh" +. "${SRCROOT}/Scripts/copy_lib_to_staging.sh" diff --git a/Scripts/copy_lib_to_staging.sh b/Scripts/copy_lib_to_staging.sh index 94a00678..72bec0fb 100755 --- a/Scripts/copy_lib_to_staging.sh +++ b/Scripts/copy_lib_to_staging.sh @@ -1,4 +1,25 @@ #!/bin/bash -export MVK_XCFWK_STAGING_DIR="${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging/${CONFIGURATION}" -. "${SRCROOT}/../Scripts/copy_to_staging.sh" +# Query the architectures in the built static library. If it contains only a single architecture, +# copy the file into a separate file in its own directory within the XCFrameworkStaging directory. +# If it contains mulitple architectures, extract each architecture into a separate file in its own +# directory within the XCFrameworkStaging directory. +# +# Requires the variable MVK_XCFWK_STAGING_DIR. +# +export MVK_PROD_FILENAME="lib${PRODUCT_NAME}.a" +export MVK_BUILT_PROD_FILE="${BUILT_PRODUCTS_DIR}/${MVK_PROD_FILENAME}" + +IFS=' ' read -ra archs <<< $(lipo -archs "${MVK_BUILT_PROD_FILE}") +if [ ${#archs[@]} -eq '1' ]; then + arch="${archs[0]}" + staging_dir="${MVK_XCFWK_STAGING_DIR}/${arch}${EFFECTIVE_PLATFORM_NAME}" + mkdir -p "${staging_dir}" + cp -a "${MVK_BUILT_PROD_FILE}" "${staging_dir}/${MVK_PROD_FILENAME}" +else + for arch in ${archs[@]}; do + staging_dir="${MVK_XCFWK_STAGING_DIR}/${arch}${EFFECTIVE_PLATFORM_NAME}" + mkdir -p "${staging_dir}" + lipo "${MVK_BUILT_PROD_FILE}" -thin ${arch} -output "${staging_dir}/${MVK_PROD_FILENAME}" + done +fi diff --git a/Scripts/copy_to_staging.sh b/Scripts/copy_to_staging.sh index 740abdd1..17044f40 100755 --- a/Scripts/copy_to_staging.sh +++ b/Scripts/copy_to_staging.sh @@ -1,33 +1,4 @@ #!/bin/bash -# Query the architectures in the built static library. If it contains only a single architecture, -# copy the file into a separate file in its own directory within the XCFrameworkStaging directory. -# If it contains mulitple architectures, extract each architecture into a separate file in its own -# directory within the XCFrameworkStaging directory. -# -# Requires the variable MVK_XCFWK_STAGING_DIR. -# -export MVK_PROD_FILENAME="lib${PRODUCT_NAME}.a" -export MVK_BUILT_PROD_FILE="${BUILT_PRODUCTS_DIR}/${MVK_PROD_FILENAME}" - -IFS=' ' read -ra archs <<< $(lipo -archs "${MVK_BUILT_PROD_FILE}") -if [ ${#archs[@]} -eq '1' ]; then - arch="${archs[0]}" - staging_dir="${MVK_XCFWK_STAGING_DIR}/${arch}${EFFECTIVE_PLATFORM_NAME}" - mkdir -p "${staging_dir}" - cp -a "${MVK_BUILT_PROD_FILE}" "${staging_dir}/${MVK_PROD_FILENAME}" -else - for arch in ${archs[@]}; do - staging_dir="${MVK_XCFWK_STAGING_DIR}/${arch}${EFFECTIVE_PLATFORM_NAME}" - mkdir -p "${staging_dir}" - lipo "${MVK_BUILT_PROD_FILE}" -thin ${arch} -output "${staging_dir}/${MVK_PROD_FILENAME}" - done -fi - - - - - - - - +export MVK_XCFWK_STAGING_DIR="${BUILT_PRODUCTS_DIR}/../XCFrameworkStaging/${CONFIGURATION}" +. "${SRCROOT}/../Scripts/copy_lib_to_staging.sh" diff --git a/Scripts/create_fat_ext_libs.sh b/Scripts/create_fat_ext_libs.sh deleted file mode 100755 index fb0a3ac6..00000000 --- a/Scripts/create_fat_ext_libs.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Load functions -. "${SRCROOT}/Scripts/create_fat_lib_func.sh" - -set -e - -export MVK_BUILT_OS_PROD_DIR="${BUILT_PRODUCTS_DIR}-${MVK_OS_PROD_EXTN}" -export MVK_BUILT_SIM_PROD_DIR="${BUILT_PRODUCTS_DIR}-${MVK_SIM_PROD_EXTN}" -export MVK_BUILT_FAT_PROD_DIR="${BUILT_PRODUCTS_DIR}-${MVK_OS}" - -create_fat_lib "libSPIRVCross.a" -create_fat_lib "libSPIRVTools.a" -create_fat_lib "libglslang.a" - diff --git a/Scripts/create_fat_lib_func.sh b/Scripts/create_fat_lib_func.sh deleted file mode 100755 index 6d48b6f0..00000000 --- a/Scripts/create_fat_lib_func.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# If both platform and simulator lib files exist, create a fat file -# from them both, otherwise if only one exists, copy it to the fat file. -# -# Takes one parameter: -# 1 - filename -# -# Requires 3 build settings: -# MVK_BUILT_OS_PROD_DIR - location to find OS input file -# MVK_BUILT_SIM_PROD_DIR - location to find simulator input file -# MVK_BUILT_FAT_PROD_DIR - location to put fat output file -function create_fat_lib() { - FILE_NAME=${1} - BUILT_OS_PROD_FILE="${MVK_BUILT_OS_PROD_DIR}/${FILE_NAME}" - BUILT_SIM_PROD_FILE="${MVK_BUILT_SIM_PROD_DIR}/${FILE_NAME}" - BUILT_FAT_PROD_FILE="${MVK_BUILT_FAT_PROD_DIR}/${FILE_NAME}" - - if [ ! -e "${MVK_BUILT_FAT_PROD_DIR}" ]; then - mkdir -p "${MVK_BUILT_FAT_PROD_DIR}" - fi - rm -rf "${BUILT_FAT_PROD_FILE}" - - if test -e "${BUILT_OS_PROD_FILE}"; then - if test -e "${BUILT_SIM_PROD_FILE}"; then - lipo \ - -create \ - -output "${BUILT_FAT_PROD_FILE}" \ - "${BUILT_OS_PROD_FILE}" \ - "${BUILT_SIM_PROD_FILE}" - else - cp -a "${BUILT_OS_PROD_FILE}" "${BUILT_FAT_PROD_FILE}" - fi - elif test -e "${BUILT_SIM_PROD_FILE}"; then - cp -a "${BUILT_SIM_PROD_FILE}" "${BUILT_FAT_PROD_FILE}" - fi -} diff --git a/Scripts/create_fat_libs.sh b/Scripts/create_fat_libs.sh deleted file mode 100755 index 4a2f9229..00000000 --- a/Scripts/create_fat_libs.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# Load functions -. "${SRCROOT}/../Scripts/create_fat_lib_func.sh" - -set -e - -#Static library -export MVK_BUILT_OS_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_OS_PROD_EXTN}" -export MVK_BUILT_SIM_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_SIM_PROD_EXTN}" -export MVK_BUILT_FAT_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_OS}" -create_fat_lib "lib${PRODUCT_NAME}.a" - -# Dynamic library -export MVK_BUILT_OS_PROD_DIR="${MVK_BUILT_OS_PROD_DIR}/dynamic" -export MVK_BUILT_SIM_PROD_DIR="${MVK_BUILT_SIM_PROD_DIR}/dynamic" -export MVK_BUILT_FAT_PROD_DIR="${MVK_BUILT_FAT_PROD_DIR}/dynamic" -create_fat_lib "lib${PRODUCT_NAME}.dylib" - -# Dynamic library dSYM -if [ "${CONFIGURATION}" == "Debug" ]; then - cp -a "${MVK_BUILT_OS_PROD_DIR}/lib${PRODUCT_NAME}.dylib.dSYM" "${MVK_BUILT_FAT_PROD_DIR}" - export MVK_BUILT_OS_PROD_DIR="${MVK_BUILT_OS_PROD_DIR}/lib${PRODUCT_NAME}.dylib.dSYM/Contents/Resources/DWARF" - export MVK_BUILT_SIM_PROD_DIR="${MVK_BUILT_SIM_PROD_DIR}/lib${PRODUCT_NAME}.dylib.dSYM/Contents/Resources/DWARF" - export MVK_BUILT_FAT_PROD_DIR="${MVK_BUILT_FAT_PROD_DIR}/lib${PRODUCT_NAME}.dylib.dSYM/Contents/Resources/DWARF" - create_fat_lib "lib${PRODUCT_NAME}.dylib" -fi diff --git a/Scripts/create_fat_libs_ios.sh b/Scripts/create_fat_libs_ios.sh deleted file mode 100755 index b5d37976..00000000 --- a/Scripts/create_fat_libs_ios.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -e - -export MVK_OS="iOS" -export MVK_OS_PROD_EXTN="iphoneos" -export MVK_SIM_PROD_EXTN="iphonesimulator" - -. "${SRCROOT}/../Scripts/create_fat_libs.sh" - diff --git a/Scripts/create_fat_libs_tvos.sh b/Scripts/create_fat_libs_tvos.sh deleted file mode 100755 index 9003f0c5..00000000 --- a/Scripts/create_fat_libs_tvos.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -e - -export MVK_OS="tvOS" -export MVK_OS_PROD_EXTN="appletvos" -export MVK_SIM_PROD_EXTN="appletvsimulator" - -. "${SRCROOT}/../Scripts/create_fat_libs.sh" - diff --git a/Scripts/create_framework.sh b/Scripts/create_framework.sh deleted file mode 100755 index 37aaca4c..00000000 --- a/Scripts/create_framework.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -export MVK_TMPLT_PATH="${PROJECT_DIR}/../Templates/framework/${MVK_OS}" -export MVK_BUILT_FRWK_PATH="${MVK_BUILT_PROD_DIR}/framework/${PRODUCT_NAME}.framework" -export MVK_BUILT_FRWK_CONTENT_PATH="${MVK_BUILT_FRWK_PATH}/${MVK_FRWK_SUBPATH}" - -mkdir -p "${MVK_BUILT_PROD_DIR}/framework" - -rm -rf "${MVK_BUILT_FRWK_PATH}" -cp -a "${MVK_TMPLT_PATH}/Template.framework" "${MVK_BUILT_FRWK_PATH}" -cp -a "${MVK_BUILT_PROD_DIR}/lib${PRODUCT_NAME}.a" "${MVK_BUILT_FRWK_CONTENT_PATH}${PRODUCT_NAME}" -cp -pRL "${PROJECT_DIR}/include/${PRODUCT_NAME}/" "${MVK_BUILT_FRWK_CONTENT_PATH}Headers" -rm -f "${MVK_BUILT_FRWK_CONTENT_PATH}Headers/README" #Remove git empty directory placeholder file diff --git a/Scripts/create_framework_ios.sh b/Scripts/create_framework_ios.sh deleted file mode 100755 index c75be1fb..00000000 --- a/Scripts/create_framework_ios.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -export MVK_OS="iOS" -export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_OS}" -export MVK_FRWK_SUBPATH="" - -. "${SRCROOT}/../Scripts/create_framework.sh" diff --git a/Scripts/create_framework_macos.sh b/Scripts/create_framework_macos.sh deleted file mode 100755 index d7760440..00000000 --- a/Scripts/create_framework_macos.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -export MVK_OS="macOS" -export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}" -export MVK_FRWK_SUBPATH="Versions/Current/" - -. "${SRCROOT}/../Scripts/create_framework.sh" - -ln -sfn "${MVK_FRWK_SUBPATH}${PRODUCT_NAME}" "${MVK_BUILT_FRWK_PATH}/${PRODUCT_NAME}" diff --git a/Scripts/create_framework_tvos.sh b/Scripts/create_framework_tvos.sh deleted file mode 100755 index 7cfde034..00000000 --- a/Scripts/create_framework_tvos.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -export MVK_OS="tvOS" -export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-${MVK_OS}" -export MVK_FRWK_SUBPATH="" - -. "${SRCROOT}/../Scripts/create_framework.sh" diff --git a/Scripts/create_xcframework_func.sh b/Scripts/create_xcframework_func.sh index 088ce7ce..af46b196 100755 --- a/Scripts/create_xcframework_func.sh +++ b/Scripts/create_xcframework_func.sh @@ -12,11 +12,11 @@ function create_xcframework() { xcfwk_path="${MVK_XCFWK_DEST_DIR}/${prod_name}.xcframework" hdr_path="${MVK_XCFWK_STAGING_DIR}/Headers/${prod_name}" - xcfwk_cmd="xcodebuild -create-xcframework -output \"${xcfwk_path}\"" + xcfwk_cmd="xcodebuild -quiet -create-xcframework -output \"${xcfwk_path}\"" for prod_staging_dir in "${MVK_XCFWK_STAGING_DIR}/${CONFIGURATION}"/*; do prod_lib_path="${prod_staging_dir}/lib${prod_name}.a" - if test -e "${prod_lib_path}"; then + if [[ -e "${prod_lib_path}" ]]; then xcfwk_cmd+=" -library \"${prod_lib_path}\"" # xcfwk_cmd+=" -headers \"${hdr_path}\"" # Headers currently break build during usage due to Xcode 12 bug: https://developer.apple.com/forums/thread/651043?answerId=628400022#628400022 fi diff --git a/Scripts/package_all.sh b/Scripts/package_all.sh index 2603ecf1..e8b65c26 100755 --- a/Scripts/package_all.sh +++ b/Scripts/package_all.sh @@ -1,19 +1,8 @@ #!/bin/bash -export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}" - -export MVK_OS="iOS" . "${SRCROOT}/Scripts/package_moltenvk.sh" - -export MVK_OS="tvOS" -. "${SRCROOT}/Scripts/package_moltenvk.sh" - -export MVK_OS="macOS" -. "${SRCROOT}/Scripts/package_moltenvk.sh" - . "${SRCROOT}/Scripts/package_moltenvk_xcframework.sh" . "${SRCROOT}/Scripts/package_shader_converter_xcframework.sh" -. "${SRCROOT}/Scripts/package_shader_converter_tool.sh" . "${SRCROOT}/Scripts/package_docs.sh" . "${SRCROOT}/Scripts/package_update_latest.sh" diff --git a/Scripts/package_moltenvk.sh b/Scripts/package_moltenvk.sh index 766865b4..c2b12b1e 100755 --- a/Scripts/package_moltenvk.sh +++ b/Scripts/package_moltenvk.sh @@ -2,28 +2,37 @@ set -e +# Copy dylibs only if the source directory exists. +# Takes two args: source build path OS suffix and destination path OS directory name +function copy_dylib() { + src_dir="${BUILD_DIR}/${CONFIGURATION}${1}/dynamic" + dst_dir="${MVK_PKG_PROD_PATH}/dylib/${2}" + +echo Copying dylib from "${src_dir}" to "${dst_dir}" + + if [[ -e "${src_dir}" ]]; then + rm -rf "${dst_dir}" + mkdir -p "${dst_dir}" + + cp -a "${src_dir}/lib${MVK_PROD_NAME}.dylib" "${dst_dir}" + + if [[ -e "${src_dir}/lib${MVK_PROD_NAME}.dylib.dSYM" ]]; then + cp -a "${src_dir}/lib${MVK_PROD_NAME}.dylib.dSYM" "${dst_dir}" + fi + + cp -a "${MVK_PROD_PROJ_PATH}/icd/${MVK_PROD_NAME}_icd.json" "${dst_dir}" + fi +} + export MVK_PROD_NAME="MoltenVK" export MVK_PROD_PROJ_PATH="${PROJECT_DIR}/${MVK_PROD_NAME}" export MVK_PKG_PROD_PATH="${PROJECT_DIR}/Package/${CONFIGURATION}/${MVK_PROD_NAME}" -export MVK_PKG_PROD_PATH_OS="${MVK_PKG_PROD_PATH}/${MVK_OS}" -rm -rf "${MVK_PKG_PROD_PATH_OS}" - -mkdir -p "${MVK_PKG_PROD_PATH_OS}/static" -cp -a "${MVK_BUILT_PROD_DIR}/lib${MVK_PROD_NAME}.a" "${MVK_PKG_PROD_PATH_OS}/static" - -mkdir -p "${MVK_PKG_PROD_PATH_OS}/dynamic" -cp -a "${MVK_BUILT_PROD_DIR}/dynamic/lib${MVK_PROD_NAME}.dylib" "${MVK_PKG_PROD_PATH_OS}/dynamic" -if test "$CONFIGURATION" = Debug; then - cp -a "${MVK_BUILT_PROD_DIR}/dynamic/lib${MVK_PROD_NAME}.dylib.dSYM" "${MVK_PKG_PROD_PATH_OS}/dynamic" -fi -cp -a "${MVK_PROD_PROJ_PATH}/icd/${MVK_PROD_NAME}_icd.json" "${MVK_PKG_PROD_PATH_OS}/dynamic" - -mkdir -p "${MVK_PKG_PROD_PATH_OS}/framework" -cp -a "${MVK_BUILT_PROD_DIR}/framework/${MVK_PROD_NAME}.framework" "${MVK_PKG_PROD_PATH_OS}/framework" - -# Remove the code signature -rm -rf "${MVK_PKG_PROD_PATH_OS}/framework/${MVK_PROD_NAME}.framework/_CodeSignature" +copy_dylib "" "macOS" +copy_dylib "-iphoneos" "iOS" +copy_dylib "-iphonesimulator" "iOS-simulator" +copy_dylib "-appletvos" "tvOS" +copy_dylib "-appletvsimulator" "tvOS-simulator" # Remove and replace header include folder rm -rf "${MVK_PKG_PROD_PATH}/include" diff --git a/Scripts/package_one_os.sh b/Scripts/package_one_os.sh deleted file mode 100755 index e8b65c26..00000000 --- a/Scripts/package_one_os.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -. "${SRCROOT}/Scripts/package_moltenvk.sh" -. "${SRCROOT}/Scripts/package_moltenvk_xcframework.sh" -. "${SRCROOT}/Scripts/package_shader_converter_xcframework.sh" -. "${SRCROOT}/Scripts/package_docs.sh" -. "${SRCROOT}/Scripts/package_update_latest.sh" - diff --git a/Scripts/package_shader_converter_tool.sh b/Scripts/package_shader_converter_tool.sh index 43330d48..98cb6590 100755 --- a/Scripts/package_shader_converter_tool.sh +++ b/Scripts/package_shader_converter_tool.sh @@ -4,6 +4,7 @@ set -e export MVK_PROD_NAME="MoltenVKShaderConverter" export MVK_PKG_PROD_PATH_OS="${PROJECT_DIR}/Package/${CONFIGURATION}/${MVK_PROD_NAME}/Tools" +export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}" rm -rf "${MVK_PKG_PROD_PATH_OS}" mkdir -p "${MVK_PKG_PROD_PATH_OS}" diff --git a/Templates/framework/iOS/Template.framework/Headers/README b/Templates/framework/iOS/Template.framework/Headers/README deleted file mode 100644 index 26382bcd..00000000 --- a/Templates/framework/iOS/Template.framework/Headers/README +++ /dev/null @@ -1 +0,0 @@ -Placeholder for empty git directory. \ No newline at end of file diff --git a/Templates/framework/macOS/Template.framework/Headers b/Templates/framework/macOS/Template.framework/Headers deleted file mode 120000 index a177d2a6..00000000 --- a/Templates/framework/macOS/Template.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/Templates/framework/macOS/Template.framework/Versions/A/Headers/README b/Templates/framework/macOS/Template.framework/Versions/A/Headers/README deleted file mode 100644 index 26382bcd..00000000 --- a/Templates/framework/macOS/Template.framework/Versions/A/Headers/README +++ /dev/null @@ -1 +0,0 @@ -Placeholder for empty git directory. \ No newline at end of file diff --git a/Templates/framework/macOS/Template.framework/Versions/Current b/Templates/framework/macOS/Template.framework/Versions/Current deleted file mode 120000 index 8c7e5a66..00000000 --- a/Templates/framework/macOS/Template.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/Templates/framework/tvOS b/Templates/framework/tvOS deleted file mode 120000 index d4676fd0..00000000 --- a/Templates/framework/tvOS +++ /dev/null @@ -1 +0,0 @@ -iOS \ No newline at end of file diff --git a/fetchDependencies b/fetchDependencies index 50989d9f..08a2cb01 100755 --- a/fetchDependencies +++ b/fetchDependencies @@ -4,31 +4,29 @@ # # fetchDependencies - Retrieves the correct versions of all dependencies # -# macOS usage: ./fetchDependencies [--ios] [--iosfat] [--tvos] [--tvosfat] [--macos] [--all] [--none] +# macOS usage: ./fetchDependencies [--macos] [--ios] [--iossim] [--tvos] [--tvossim] [--all] [--none] # [-v] [--debug] [--build-spirv-tools] # [--v-headers-root path] [--spirv-cross-root path] [--glslang-root path] # -# --ios -# Build the external libraries for the iOS platform. -# -# --iosfat -# Build a single binary for each external library, each containing code -# for both iOS and iOS Simulator platforms. -# -# --tvos -# Build the external libraries for the tvOS platform. -# -# --tvosfat -# Build a single binary for each external library, each containing code -# for both tvOS and tvOS Simulator platforms. -# # --macos # Build the external libraries for the macOS platform. # +# --ios +# Build the external libraries for the iOS platform. +# +# --iossim +# Build the external libraries for the iOS Simulator platform. +# +# --tvos +# Build the external libraries for the tvOS platform. +# +# --tvossim +# Build the external libraries for the tvOS Simulator platform. +# # --all -# Equivalent to specifying [--iosfat --tvosfat --macos]. Results in thee -# binaries for each external library: one for the iOS and iOS Simulator platforms, -# one for the tvOS and tvOS Simulator platforms, and one for the macOS platform. +# Equivalent to specifying [--macos --ios --iossim --tvos --tvossim]. +# Results in one XCFramework for each external library, each containing +# binaries for all supported platforms. # # --none # Don't build the external libraries for any platform. @@ -94,8 +92,7 @@ while (( "$#" )); do BLD_SPECIFIED="Y" shift 1 ;; - --iosfat) - BLD_IOS="Y" + --iossim) BLD_IOS_SIM="Y" BLD_SPECIFIED="Y" shift 1 @@ -105,8 +102,7 @@ while (( "$#" )); do BLD_SPECIFIED="Y" shift 1 ;; - --tvosfat) - BLD_TVOS="Y" + --tvossim) BLD_TVOS_SIM="Y" BLD_SPECIFIED="Y" shift 1 @@ -375,7 +371,7 @@ cd .. if [ "$BLD_SPECIFIED" = "" ]; then echo "ERROR: You did not specify a platform to build." echo "Include one or more of the following platform options:" - echo " --ios --iosfat --tvos --tvosfat --macos --all" + echo " --macos --ios --iossim --tvos --tvossim --all" echo "See the instructions in the fetchDependencies script for more info." exit 1 fi @@ -392,7 +388,7 @@ function build_impl() { XC_PLTFM=${2} XC_SCHEME="${EXT_DEPS}-${XC_OS}" - XC_LCL_DD_PATH="${XC_DD_PATH}/Intermediates/${XC_OS}" + XC_LCL_DD_PATH="${XC_DD_PATH}/Intermediates/${XC_PLTFM}" XC_DEST="generic/platform=${XC_PLTFM}" echo Building external libraries for ${XC_PLTFM} @@ -414,29 +410,9 @@ function build_impl() { # 2 - platform function build() { if [ "$XC_USE_BCKGND" != "" ]; then - build_impl ${1} ${2} & + build_impl "${1}" "${2}" & else - build_impl ${1} ${2} - fi -} - -# Build a fat library for the OS containing code for the OS and its Simulator -# Builds serially to ensure both are built -# 1 - OS -function build_fat_impl() { - XC_OS=${1} - - build_impl ${XC_OS} ${XC_OS} - build_impl ${XC_OS} "${XC_OS} Simulator" -} - -# Select whether or not to run the build in parallel. -# 1 - OS -function build_fat() { - if [ "$XC_USE_BCKGND" != "" ]; then - build_fat_impl ${1} & - else - build_fat_impl ${1} + build_impl "${1}" "${2}" fi } @@ -460,19 +436,19 @@ if [ "$BLD_MACOS" != "" ]; then fi if [ "$BLD_IOS" != "" ]; then - if [ "$BLD_IOS_SIM" != "" ]; then - build_fat "iOS" - else - build "iOS" "iOS" - fi + build "iOS" "iOS" +fi + +if [ "$BLD_IOS_SIM" != "" ]; then + build "iOS" "iOS Simulator" fi if [ "$BLD_TVOS" != "" ]; then - if [ "$BLD_TVOS_SIM" != "" ]; then - build_fat "tvOS" - else - build "tvOS" "tvOS" - fi + build "tvOS" "tvOS" +fi + +if [ "$BLD_TVOS_SIM" != "" ]; then + build "tvOS" "tvOS Simulator" fi # Wait for any background process (if selected) to finish