Make Xcode targets more specific

This makes sure they show up in the scheme selection menu when included with other libraries in top level Xcode projects
main
Sam Lantinga 2023-07-31 21:17:03 -07:00
parent efe114c300
commit 65538011ca
2 changed files with 19 additions and 27 deletions

View File

@ -15,8 +15,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: platform:
- { name: iOS, target: Framework, sdk: iphoneos } - { name: iOS, target: SDL3.framework, sdk: iphoneos }
- { name: tvOS, target: Framework, sdk: appletvos } - { name: tvOS, target: SDL3.framework, sdk: appletvos }
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -7,27 +7,27 @@
objects = { objects = {
/* Begin PBXAggregateTarget section */ /* Begin PBXAggregateTarget section */
F3676F582A7885080091160D /* Create DMG */ = { F3676F582A7885080091160D /* SDL3.dmg */ = {
isa = PBXAggregateTarget; isa = PBXAggregateTarget;
buildConfigurationList = F3676F592A7885080091160D /* Build configuration list for PBXAggregateTarget "Create DMG" */; buildConfigurationList = F3676F592A7885080091160D /* Build configuration list for PBXAggregateTarget "SDL3.dmg" */;
buildPhases = ( buildPhases = (
F3676F5E2A78852D0091160D /* ShellScript */, F3676F5E2A78852D0091160D /* ShellScript */,
); );
dependencies = ( dependencies = (
F3676F5D2A7885130091160D /* PBXTargetDependency */, F3676F5D2A7885130091160D /* PBXTargetDependency */,
); );
name = "Create DMG"; name = SDL3.dmg;
productName = "Create DMG"; productName = "Create DMG";
}; };
F3B38CEC296F63B6005DA6D3 /* SDL.xcframework */ = { F3B38CEC296F63B6005DA6D3 /* SDL3.xcframework */ = {
isa = PBXAggregateTarget; isa = PBXAggregateTarget;
buildConfigurationList = F3B38CED296F63B6005DA6D3 /* Build configuration list for PBXAggregateTarget "SDL.xcframework" */; buildConfigurationList = F3B38CED296F63B6005DA6D3 /* Build configuration list for PBXAggregateTarget "SDL3.xcframework" */;
buildPhases = ( buildPhases = (
F3B38CF0296F63D1005DA6D3 /* ShellScript */, F3B38CF0296F63D1005DA6D3 /* ShellScript */,
); );
dependencies = ( dependencies = (
); );
name = SDL.xcframework; name = SDL3.xcframework;
productName = xcFramework; productName = xcFramework;
}; };
/* End PBXAggregateTarget section */ /* End PBXAggregateTarget section */
@ -2263,9 +2263,9 @@
/* End PBXHeadersBuildPhase section */ /* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
BECDF5FE0761BA81005FE872 /* Framework */ = { BECDF5FE0761BA81005FE872 /* SDL3.framework */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */; buildConfigurationList = 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "SDL3.framework" */;
buildPhases = ( buildPhases = (
BECDF5FF0761BA81005FE872 /* Headers */, BECDF5FF0761BA81005FE872 /* Headers */,
BECDF62A0761BA81005FE872 /* Resources */, BECDF62A0761BA81005FE872 /* Resources */,
@ -2278,7 +2278,7 @@
comments = "We recommend installing to /Library/Frameworks\nAn alternative is $(HOME)/Library/Frameworks for per-user if permissions are an issue.\n\nAdd the framework to the Groups & Files panel (under Linked Frameworks is a good place) and enable the check box for the targets that need to link to it. You can also manually add \"-framework SDL\" to your linker flags if you don't like the check box system.\n\nAdd /Library/Frameworks/SDL.framework/Headers to your header search path\nAdd /Library/Frameworks to your library search path\n(Adjust the two above if installed in $(HOME)/Library/Frameworks. You can also list both paths if you want robustness.)\n\nWe used to use an exports file. It was becoming a maintenance issue we kept neglecting, so we have removed it.\n\n"; comments = "We recommend installing to /Library/Frameworks\nAn alternative is $(HOME)/Library/Frameworks for per-user if permissions are an issue.\n\nAdd the framework to the Groups & Files panel (under Linked Frameworks is a good place) and enable the check box for the targets that need to link to it. You can also manually add \"-framework SDL\" to your linker flags if you don't like the check box system.\n\nAdd /Library/Frameworks/SDL.framework/Headers to your header search path\nAdd /Library/Frameworks to your library search path\n(Adjust the two above if installed in $(HOME)/Library/Frameworks. You can also list both paths if you want robustness.)\n\nWe used to use an exports file. It was becoming a maintenance issue we kept neglecting, so we have removed it.\n\n";
dependencies = ( dependencies = (
); );
name = Framework; name = SDL3.framework;
productInstallPath = "@executable_path/../Frameworks"; productInstallPath = "@executable_path/../Frameworks";
productName = SDL; productName = SDL;
productReference = BECDF66C0761BA81005FE872 /* SDL3.framework */; productReference = BECDF66C0761BA81005FE872 /* SDL3.framework */;
@ -2314,9 +2314,9 @@
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
BECDF5FE0761BA81005FE872 /* Framework */, BECDF5FE0761BA81005FE872 /* SDL3.framework */,
F3B38CEC296F63B6005DA6D3 /* SDL.xcframework */, F3B38CEC296F63B6005DA6D3 /* SDL3.xcframework */,
F3676F582A7885080091160D /* Create DMG */, F3676F582A7885080091160D /* SDL3.dmg */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
@ -2369,7 +2369,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\nSCHEME=\"Framework\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -sdk macosx \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -sdk iphonesimulator \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -sdk iphoneos \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -sdk appletvsimulator \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -sdk appletvos \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n"; shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3\"\nPROJECT_NAME=\"SDL\"\nSCHEME=\"SDL3.framework\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -sdk macosx \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -sdk iphonesimulator \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -sdk iphoneos \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -sdk appletvsimulator \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -sdk appletvos \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n";
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
@ -2576,7 +2576,7 @@
/* Begin PBXTargetDependency section */ /* Begin PBXTargetDependency section */
F3676F5D2A7885130091160D /* PBXTargetDependency */ = { F3676F5D2A7885130091160D /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = F3B38CEC296F63B6005DA6D3 /* SDL.xcframework */; target = F3B38CEC296F63B6005DA6D3 /* SDL3.xcframework */;
targetProxy = F3676F5C2A7885130091160D /* PBXContainerItemProxy */; targetProxy = F3676F5C2A7885130091160D /* PBXContainerItemProxy */;
}; };
/* End PBXTargetDependency section */ /* End PBXTargetDependency section */
@ -2699,39 +2699,31 @@
F3676F5A2A7885080091160D /* Debug */ = { F3676F5A2A7885080091160D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = Debug; name = Debug;
}; };
F3676F5B2A7885080091160D /* Release */ = { F3676F5B2A7885080091160D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = Release; name = Release;
}; };
F3B38CEE296F63B6005DA6D3 /* Debug */ = { F3B38CEE296F63B6005DA6D3 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
}; };
name = Debug; name = Debug;
}; };
F3B38CEF296F63B6005DA6D3 /* Release */ = { F3B38CEF296F63B6005DA6D3 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CODE_SIGN_STYLE = Automatic;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
}; };
name = Release; name = Release;
}; };
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */ = { 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "SDL3.framework" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
00CFA628106A568900758660 /* Debug */, 00CFA628106A568900758660 /* Debug */,
@ -2749,7 +2741,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug; defaultConfigurationName = Debug;
}; };
F3676F592A7885080091160D /* Build configuration list for PBXAggregateTarget "Create DMG" */ = { F3676F592A7885080091160D /* Build configuration list for PBXAggregateTarget "SDL3.dmg" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
F3676F5A2A7885080091160D /* Debug */, F3676F5A2A7885080091160D /* Debug */,
@ -2758,7 +2750,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug; defaultConfigurationName = Debug;
}; };
F3B38CED296F63B6005DA6D3 /* Build configuration list for PBXAggregateTarget "SDL.xcframework" */ = { F3B38CED296F63B6005DA6D3 /* Build configuration list for PBXAggregateTarget "SDL3.xcframework" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
F3B38CEE296F63B6005DA6D3 /* Debug */, F3B38CEE296F63B6005DA6D3 /* Debug */,