Skip to content

Commit

Permalink
iOS tv-casting-app: updating build settings to allow arm64 simulator …
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadb-amazon committed Mar 27, 2024
1 parent 1f078a8 commit bc96469
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */; };
3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8735286A555500771BAD /* libTvCastingCommon.a */; };
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8736286A555500771BAD /* libmbedtls.a */; settings = {ATTRIBUTES = (Required, ); }; };
3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB8739286A593700771BAD /* DiscoveredNodeData.mm */; };
3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB873A286A593700771BAD /* CastingServerBridge.h */; };
3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB873B286A593700771BAD /* DiscoveredNodeData.h */; };
Expand Down Expand Up @@ -56,7 +55,6 @@
3CCB871D2869085400771BAD /* MatterTvCastingBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MatterTvCastingBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3CCB87202869085400771BAD /* MatterTvCastingBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterTvCastingBridge.h; sourceTree = "<group>"; };
3CCB8735286A555500771BAD /* libTvCastingCommon.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTvCastingCommon.a; path = lib/libTvCastingCommon.a; sourceTree = BUILT_PRODUCTS_DIR; };
3CCB8736286A555500771BAD /* libmbedtls.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmbedtls.a; path = lib/libmbedtls.a; sourceTree = BUILT_PRODUCTS_DIR; };
3CCB8739286A593700771BAD /* DiscoveredNodeData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiscoveredNodeData.mm; sourceTree = "<group>"; };
3CCB873A286A593700771BAD /* CastingServerBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CastingServerBridge.h; sourceTree = "<group>"; };
3CCB873B286A593700771BAD /* DiscoveredNodeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiscoveredNodeData.h; sourceTree = "<group>"; };
Expand All @@ -77,7 +75,6 @@
buildActionMask = 2147483647;
files = (
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */,
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -88,7 +85,6 @@
isa = PBXGroup;
children = (
3CCB871F2869085400771BAD /* MatterTvCastingBridge */,
3CCB8736286A555500771BAD /* libmbedtls.a */,
3CCB8735286A555500771BAD /* libTvCastingCommon.a */,
3CCB871E2869085400771BAD /* Products */,
);
Expand Down Expand Up @@ -312,7 +308,6 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -400,6 +395,10 @@
3CCB87252869085400771BAD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"ARCHS[sdk=iphonesimulator*]" = (
arm64,
x86_64,
);
CHIP_ROOT = "$(PROJECT_DIR)/../../../..";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3CCB871C2869085400771BAD"
BuildableName = "MatterTvCastingBridge.framework"
BlueprintName = "MatterTvCastingBridge"
ReferencedContainer = "container:MatterTvCastingBridge.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3CCB871C2869085400771BAD"
BuildableName = "MatterTvCastingBridge.framework"
BlueprintName = "MatterTvCastingBridge"
ReferencedContainer = "container:MatterTvCastingBridge.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -60,35 +60,31 @@ for define in "${defines[@]}"; do
done
target_defines=[${target_defines:1}]

declare target_arch=
declare target_cpu=
case $PLATFORM_PREFERRED_ARCH in
i386)
target_cpu=x86
;;
x86_64)
target_cpu=x64
;;
armv7)
target_cpu=arm
;;
arm64)
target_cpu=arm64
;;
*)
echo >&2
;;
esac

declare target_cflags='"-target","'"$PLATFORM_PREFERRED_ARCH"'-'"$LLVM_TARGET_TRIPLE_VENDOR"'-'"$LLVM_TARGET_TRIPLE_OS_VERSION"'"'
declare target_cflags=
declare current_arch="$(uname -m)"

read -r -a archs <<<"$ARCHS"

for arch in "${archs[@]}"; do
target_cflags+=',"-arch","'"$arch"'"'
if [ -z "$target_arch" ] || [ "$arch" = "$current_arch" ]; then
target_arch="$arch"
case "$arch" in
x86_64) target_cpu="x64" ;;
*) target_cpu="$arch" ;;
esac
fi
if [ -n "$target_cflags" ]; then
target_cflags+=','
fi
target_cflags+='"-arch","'"$arch"'"'
done

[[ $ENABLE_BITCODE == YES ]] && {
target_cflags+=',"-flto"'
if [ -n "$target_cflags" ]; then
target_cflags+=','
fi
target_cflags+='"-flto"'
}

target_cflags+=',"-fno-c++-static-destructors"'
Expand All @@ -101,6 +97,8 @@ declare -a args=(
'target_cpu="'"$target_cpu"'"'
'target_defines='"$target_defines"
'target_cflags=['"$target_cflags"']'
"mac_target_arch=\"$target_arch\""
"mac_deployment_target=\"$LLVM_TARGET_TRIPLE_OS_VERSION$LLVM_TARGET_TRIPLE_SUFFIX\""
'build_tv_casting_common_a=true'
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -376,6 +375,10 @@
3CC0E9052841DD3500EC6A18 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"ARCHS[sdk=iphonesimulator*]" = (
arm64,
x86_64,
);
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
Expand Down

0 comments on commit bc96469

Please sign in to comment.