Support iOS simulator and fat library builds of MoltenVK libraries.
Create fat builds of static, dynamic & framework libraries if both iOS and simulator versions have been created from separate manual Xcode builds. Refactor scripts for creating fat libraries to reuse across projects. Add MVK_BUILT_PROD_DIR to replace use of BUILT_PRODUCTS_DIR in most scripts to allow flexibility across per-platform compilation.
This commit is contained in:
parent
50828dde93
commit
9fea13773d
@ -641,6 +641,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"\"$(SRCROOT)/../../../MoltenVK/iOS/framework\"",
|
||||
@ -655,6 +656,7 @@
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
MARKETING_VERSION = 1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.API-Samples";
|
||||
PRODUCT_NAME = "API-Samples";
|
||||
SDKROOT = iphoneos;
|
||||
@ -666,6 +668,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"\"$(SRCROOT)/../../../MoltenVK/iOS/framework\"",
|
||||
@ -676,6 +679,7 @@
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
MARKETING_VERSION = 1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.API-Samples";
|
||||
PRODUCT_NAME = "API-Samples";
|
||||
SDKROOT = iphoneos;
|
||||
|
@ -16,10 +16,14 @@
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string></string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
|
@ -346,6 +346,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
@ -356,6 +357,7 @@
|
||||
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;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@ -366,6 +368,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
GCC_PREFIX_HEADER = "$(SRCROOT)/iOS/Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
@ -376,6 +379,7 @@
|
||||
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;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
|
@ -16,10 +16,14 @@
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string></string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
|
@ -353,11 +353,13 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
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\"";
|
||||
MARKETING_VERSION = 1;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
@ -367,11 +369,13 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
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\"";
|
||||
MARKETING_VERSION = 1;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
|
@ -16,10 +16,14 @@
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string></string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
|
@ -1114,7 +1114,8 @@
|
||||
A90FD89F21CC4EAB00B92BB2 /* libSPIRVCross.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSPIRVCross.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A90FD9E421CC4EB900B92BB2 /* libSPIRVCross.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSPIRVCross.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A91BF011235F9C510039B7DE /* gen_spirv_cross_rev_hdr.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = gen_spirv_cross_rev_hdr.sh; sourceTree = "<group>"; };
|
||||
A932E9C5249A743B00D64150 /* create_fat_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs.sh; sourceTree = "<group>"; };
|
||||
A932E9C5249A743B00D64150 /* create_fat_lib_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_lib_func.sh; sourceTree = "<group>"; };
|
||||
A932E9DF249BC44D00D64150 /* create_fat_ext_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_ext_libs.sh; sourceTree = "<group>"; };
|
||||
A9415EF624366B0E00566F16 /* packagePregenSpirvToolsHeaders */ = {isa = PBXFileReference; lastKnownFileType = text; path = packagePregenSpirvToolsHeaders; sourceTree = "<group>"; };
|
||||
A95D90A723A7F1E500CBCC60 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
|
||||
A95D90AA23A7F1E500CBCC60 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
|
||||
@ -1842,7 +1843,8 @@
|
||||
A9679AAB21D2699800856BF7 /* Scripts */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A932E9C5249A743B00D64150 /* create_fat_libs.sh */,
|
||||
A932E9DF249BC44D00D64150 /* create_fat_ext_libs.sh */,
|
||||
A932E9C5249A743B00D64150 /* create_fat_lib_func.sh */,
|
||||
A91BF011235F9C510039B7DE /* gen_spirv_cross_rev_hdr.sh */,
|
||||
A9679AAE21D269D900856BF7 /* package_ext_libs.sh */,
|
||||
A9415EF624366B0E00566F16 /* packagePregenSpirvToolsHeaders */,
|
||||
@ -3103,7 +3105,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "export MVK_OS=\"iOS\"\nexport MVK_OS_PROD_EXTN=\"iphoneos\"\nexport MVK_SIM_PROD_EXTN=\"iphonesimulator\"\n\n\"${SRCROOT}/Scripts/create_fat_libs.sh\"\n";
|
||||
shellScript = "export MVK_OS=\"iOS\"\nexport MVK_OS_PROD_EXTN=\"iphoneos\"\nexport MVK_SIM_PROD_EXTN=\"iphonesimulator\"\n\n. \"${SRCROOT}/Scripts/create_fat_ext_libs.sh\"\n";
|
||||
};
|
||||
A9679AAF21D26C1400856BF7 /* Package Libraries */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@ -3121,7 +3123,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "export MVK_OS=\"iOS\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}-${MVK_OS}\"\n\n\"${SRCROOT}/Scripts/package_ext_libs.sh\"\n";
|
||||
shellScript = "export MVK_OS=\"iOS\"\nexport MVK_BUILT_PROD_PATH=\"${BUILT_PRODUCTS_DIR}-${MVK_OS}\"\n\n. \"${SRCROOT}/Scripts/package_ext_libs.sh\"\n";
|
||||
};
|
||||
A9679AB021D26C7000856BF7 /* Package Libraries */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
|
@ -821,6 +821,7 @@
|
||||
A9B8EE071A98D796009C5A02 /* Headers */,
|
||||
A9B8EE051A98D796009C5A02 /* Sources */,
|
||||
A9731FAD1EDDAE39006B7298 /* Create Dynamic Library */,
|
||||
A9EE084F249BD4AE00E523A2 /* Create Fat Libraries */,
|
||||
A92EF79721854B3300C8B91B /* Create Framework */,
|
||||
);
|
||||
buildRules = (
|
||||
@ -1000,6 +1001,24 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = ". \"${SRCROOT}/../Scripts/create_dylib_ios.sh\"\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";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
@ -184,6 +184,9 @@
|
||||
A9C70F45221B04C800FBA31A /* create_dylib_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_dylib_ios.sh; sourceTree = "<group>"; };
|
||||
A9DA8340218A198C002AA662 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = "<group>"; };
|
||||
A9DA8341218A198C002AA662 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
|
||||
A9EE084A249BD49200E523A2 /* create_fat_lib_func.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_lib_func.sh; sourceTree = "<group>"; };
|
||||
A9EE084E249BD49200E523A2 /* create_fat_libs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs.sh; sourceTree = "<group>"; };
|
||||
A9EE0851249BD71C00E523A2 /* create_fat_libs_ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = create_fat_libs_ios.sh; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
@ -224,6 +227,9 @@
|
||||
A9C70F45221B04C800FBA31A /* create_dylib_ios.sh */,
|
||||
A9C70F41221B04C800FBA31A /* create_dylib_macos.sh */,
|
||||
A975D55C213F25D700D4834F /* create_dylib.sh */,
|
||||
A9EE084A249BD49200E523A2 /* create_fat_lib_func.sh */,
|
||||
A9EE0851249BD71C00E523A2 /* create_fat_libs_ios.sh */,
|
||||
A9EE084E249BD49200E523A2 /* create_fat_libs.sh */,
|
||||
A941E2B1221AEBD000890C56 /* create_framework_ios.sh */,
|
||||
A941E2B2221AEBD000890C56 /* create_framework_macos.sh */,
|
||||
A99A760321852584000A8E2A /* create_framework.sh */,
|
||||
|
@ -337,6 +337,7 @@
|
||||
A93747271A9A8B2900F29B34 /* Sources */,
|
||||
A972AD2821CEE6310013AB25 /* Frameworks */,
|
||||
A9C70F49221B075700FBA31A /* Create Dynamic Library */,
|
||||
A9303625249BDF6B00DE139C /* Create Fat Libraries */,
|
||||
A941E2A7221AC9C300890C56 /* Create Framework */,
|
||||
);
|
||||
buildRules = (
|
||||
@ -375,6 +376,7 @@
|
||||
A93903BA1C57E9D700FE90DC /* Sources */,
|
||||
A972AD2E21CEE6F50013AB25 /* Frameworks */,
|
||||
A9C70F4B221B077C00FBA31A /* Create Dynamic Library */,
|
||||
A9303626249BDFA000DE139C /* Create Fat Libraries */,
|
||||
A941E2A8221AC9E800890C56 /* Create Framework */,
|
||||
);
|
||||
buildRules = (
|
||||
@ -457,6 +459,42 @@
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
A9303625249BDF6B00DE139C /* 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";
|
||||
};
|
||||
A9303626249BDFA000DE139C /* 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";
|
||||
};
|
||||
A941E2A7221AC9C300890C56 /* Create Framework */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -2,11 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}"
|
||||
export MVK_DYLIB_NAME="lib${PRODUCT_NAME}.dylib"
|
||||
export MVK_SYS_FWK_DIR="${SDK_DIR}/System/Library/Frameworks"
|
||||
export MVK_USR_LIB_DIR="${SDK_DIR}/usr/lib"
|
||||
|
||||
mkdir -p "${BUILT_PRODUCTS_DIR}/dynamic"
|
||||
mkdir -p "${MVK_BUILT_PROD_DIR}/dynamic"
|
||||
|
||||
if test x"${ENABLE_BITCODE}" = xYES; then
|
||||
MVK_EMBED_BITCODE="-fembed-bitcode"
|
||||
@ -26,7 +27,7 @@ clang++ \
|
||||
-stdlib=${CLANG_CXX_LIBRARY} \
|
||||
-dynamiclib \
|
||||
$(printf -- "-arch %s " ${ARCHS}) \
|
||||
-m${MVK_OS}-version-min=${MVK_MIN_OS_VERSION} \
|
||||
-m${MVK_OS_CLANG}-version-min=${MVK_MIN_OS_VERSION} \
|
||||
-compatibility_version 1.0.0 -current_version 1.0.0 \
|
||||
-install_name "@rpath/${MVK_DYLIB_NAME}" \
|
||||
-Wno-incompatible-sysroot \
|
||||
@ -37,11 +38,11 @@ ${MVK_LINK_WARN} \
|
||||
-iframework ${MVK_SYS_FWK_DIR} \
|
||||
-framework Metal ${MVK_IOSURFACE_FWK} -framework ${MVK_UX_FWK} -framework QuartzCore -framework CoreGraphics -framework IOKit -framework Foundation \
|
||||
--library-directory ${MVK_USR_LIB_DIR} \
|
||||
-o "${BUILT_PRODUCTS_DIR}/dynamic/${MVK_DYLIB_NAME}" \
|
||||
-force_load "${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a"
|
||||
-o "${MVK_BUILT_PROD_DIR}/dynamic/${MVK_DYLIB_NAME}" \
|
||||
-force_load "${MVK_BUILT_PROD_DIR}/lib${PRODUCT_NAME}.a"
|
||||
|
||||
if test "$CONFIGURATION" = Debug; then
|
||||
mkdir -p "${BUILT_PRODUCTS_DIR}/dynamic"
|
||||
dsymutil "${BUILT_PRODUCTS_DIR}/dynamic/${MVK_DYLIB_NAME}" \
|
||||
-o "${BUILT_PRODUCTS_DIR}/dynamic/${MVK_DYLIB_NAME}.dSYM"
|
||||
mkdir -p "${MVK_BUILT_PROD_DIR}/dynamic"
|
||||
dsymutil "${MVK_BUILT_PROD_DIR}/dynamic/${MVK_DYLIB_NAME}" \
|
||||
-o "${MVK_BUILT_PROD_DIR}/dynamic/${MVK_DYLIB_NAME}.dSYM"
|
||||
fi
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
export MVK_OS="ios"
|
||||
export MVK_OS_CLANG="ios"
|
||||
export MVK_UX_FWK="UIKit"
|
||||
export MVK_MIN_OS_VERSION=${IPHONEOS_DEPLOYMENT_TARGET}
|
||||
export MVK_IOSURFACE_FWK="-framework IOSurface"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
export MVK_OS="macosx"
|
||||
export MVK_OS_CLANG="macosx"
|
||||
export MVK_UX_FWK="AppKit"
|
||||
export MVK_MIN_OS_VERSION=${MACOSX_DEPLOYMENT_TARGET}
|
||||
export MVK_IOSURFACE_FWK="-framework IOSurface"
|
||||
|
15
Scripts/create_fat_ext_libs.sh
Executable file
15
Scripts/create_fat_ext_libs.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/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"
|
||||
|
37
Scripts/create_fat_lib_func.sh
Executable file
37
Scripts/create_fat_lib_func.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/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
|
||||
}
|
@ -1,42 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load functions
|
||||
. "${SRCROOT}/../Scripts/create_fat_lib_func.sh"
|
||||
|
||||
set -e
|
||||
|
||||
# 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.
|
||||
function create_fat_lib() {
|
||||
export MVK_BUILT_OS_PROD_FILE="${MVK_BUILT_OS_PROD_DIR}/lib${MVK_PROD_NAME}.a"
|
||||
export MVK_BUILT_SIM_PROD_FILE="${MVK_BUILT_SIM_PROD_DIR}/lib${MVK_PROD_NAME}.a"
|
||||
export MVK_BUILT_FAT_PROD_FILE="${MVK_BUILT_FAT_PROD_DIR}/lib${MVK_PROD_NAME}.a"
|
||||
#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}"
|
||||
|
||||
if test -f "${MVK_BUILT_OS_PROD_FILE}"; then
|
||||
if test -f "${MVK_BUILT_SIM_PROD_FILE}"; then
|
||||
lipo \
|
||||
-create \
|
||||
-output "${MVK_BUILT_FAT_PROD_FILE}" \
|
||||
"${MVK_BUILT_OS_PROD_FILE}" \
|
||||
"${MVK_BUILT_SIM_PROD_FILE}"
|
||||
else
|
||||
cp -a "${MVK_BUILT_OS_PROD_FILE}" "${MVK_BUILT_FAT_PROD_FILE}"
|
||||
fi
|
||||
elif test -f "${MVK_BUILT_SIM_PROD_FILE}"; then
|
||||
cp -a "${MVK_BUILT_SIM_PROD_FILE}" "${MVK_BUILT_FAT_PROD_FILE}"
|
||||
fi
|
||||
}
|
||||
create_fat_lib "lib${PRODUCT_NAME}.a"
|
||||
|
||||
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}"
|
||||
# Dynamic library and associated dSYM
|
||||
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"
|
||||
|
||||
rm -rf "${MVK_BUILT_FAT_PROD_DIR}"
|
||||
mkdir -p "${MVK_BUILT_FAT_PROD_DIR}"
|
||||
|
||||
export MVK_PROD_NAME="SPIRVCross"
|
||||
create_fat_lib
|
||||
|
||||
export MVK_PROD_NAME="SPIRVTools"
|
||||
create_fat_lib
|
||||
|
||||
export MVK_PROD_NAME="glslang"
|
||||
create_fat_lib
|
||||
create_fat_lib "lib${PRODUCT_NAME}.dylib"
|
||||
create_fat_lib "lib${PRODUCT_NAME}.dylib.dSYM"
|
||||
|
||||
|
10
Scripts/create_fat_libs_ios.sh
Executable file
10
Scripts/create_fat_libs_ios.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/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"
|
||||
|
@ -3,13 +3,13 @@
|
||||
set -e
|
||||
|
||||
export MVK_TMPLT_PATH="${PROJECT_DIR}/../Templates/framework/${MVK_OS}"
|
||||
export MVK_BUILT_FRWK_PATH="${BUILT_PRODUCTS_DIR}/framework/${PRODUCT_NAME}.framework"
|
||||
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 "${BUILT_PRODUCTS_DIR}/framework"
|
||||
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 "${BUILT_PRODUCTS_DIR}/lib${PRODUCT_NAME}.a" "${MVK_BUILT_FRWK_CONTENT_PATH}${PRODUCT_NAME}"
|
||||
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
|
||||
|
@ -3,6 +3,7 @@
|
||||
set -e
|
||||
|
||||
export MVK_OS="iOS"
|
||||
export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}/../${CONFIGURATION}-iOS"
|
||||
export MVK_FRWK_SUBPATH=""
|
||||
|
||||
. "${SRCROOT}/../Scripts/create_framework.sh"
|
||||
|
@ -3,6 +3,7 @@
|
||||
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"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
export MVK_OS="iOS"
|
||||
export MVK_BUILT_PROD_PATH="${BUILT_PRODUCTS_DIR}-iphoneos"
|
||||
export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}-iOS"
|
||||
|
||||
. "${SRCROOT}/Scripts/package_moltenvk.sh"
|
||||
. "${SRCROOT}/Scripts/package_shader_converter.sh"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
export MVK_OS="macOS"
|
||||
export MVK_BUILT_PROD_PATH="${BUILT_PRODUCTS_DIR}"
|
||||
export MVK_BUILT_PROD_DIR="${BUILT_PRODUCTS_DIR}"
|
||||
|
||||
. "${SRCROOT}/Scripts/package_moltenvk.sh"
|
||||
. "${SRCROOT}/Scripts/package_shader_converter.sh"
|
||||
|
@ -10,17 +10,17 @@ 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_PATH}/lib${MVK_PROD_NAME}.a" "${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_PATH}/dynamic/lib${MVK_PROD_NAME}.dylib" "${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_PATH}/dynamic/lib${MVK_PROD_NAME}.dylib.dSYM" "${MVK_PKG_PROD_PATH_OS}/dynamic"
|
||||
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_PATH}/framework/${MVK_PROD_NAME}.framework" "${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"
|
||||
|
@ -9,13 +9,13 @@ 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_PATH}/lib${MVK_PROD_NAME}.a" "${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_PATH}/dynamic/lib${MVK_PROD_NAME}.dylib" "${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_PATH}/dynamic/lib${MVK_PROD_NAME}.dylib.dSYM" "${MVK_PKG_PROD_PATH_OS}/dynamic"
|
||||
cp -a "${MVK_BUILT_PROD_DIR}/dynamic/lib${MVK_PROD_NAME}.dylib.dSYM" "${MVK_PKG_PROD_PATH_OS}/dynamic"
|
||||
fi
|
||||
|
||||
mkdir -p "${MVK_PKG_PROD_PATH_OS}/framework"
|
||||
cp -a "${MVK_BUILT_PROD_PATH}/framework/${MVK_PROD_NAME}.framework" "${MVK_PKG_PROD_PATH_OS}/framework"
|
||||
cp -a "${MVK_BUILT_PROD_DIR}/framework/${MVK_PROD_NAME}.framework" "${MVK_PKG_PROD_PATH_OS}/framework"
|
||||
|
@ -7,4 +7,4 @@ export MVK_PKG_PROD_PATH_OS="${PROJECT_DIR}/Package/${CONFIGURATION}/${MVK_PROD_
|
||||
|
||||
rm -rf "${MVK_PKG_PROD_PATH_OS}"
|
||||
mkdir -p "${MVK_PKG_PROD_PATH_OS}"
|
||||
cp -a "${MVK_BUILT_PROD_PATH}/${MVK_PROD_NAME}" "${MVK_PKG_PROD_PATH_OS}"
|
||||
cp -a "${MVK_BUILT_PROD_DIR}/${MVK_PROD_NAME}" "${MVK_PKG_PROD_PATH_OS}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user