Skip to content

Commit e4116f9

Browse files
iOS tv-casting-app: updating build settings to allow arm64 simulator builds project-chip#32680
1 parent 1f078a8 commit e4116f9

File tree

4 files changed

+94
-28
lines changed

4 files changed

+94
-28
lines changed

examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */; };
2020
3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
2121
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8735286A555500771BAD /* libTvCastingCommon.a */; };
22-
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8736286A555500771BAD /* libmbedtls.a */; settings = {ATTRIBUTES = (Required, ); }; };
2322
3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB8739286A593700771BAD /* DiscoveredNodeData.mm */; };
2423
3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB873A286A593700771BAD /* CastingServerBridge.h */; };
2524
3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB873B286A593700771BAD /* DiscoveredNodeData.h */; };
@@ -56,7 +55,6 @@
5655
3CCB871D2869085400771BAD /* MatterTvCastingBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MatterTvCastingBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5756
3CCB87202869085400771BAD /* MatterTvCastingBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterTvCastingBridge.h; sourceTree = "<group>"; };
5857
3CCB8735286A555500771BAD /* libTvCastingCommon.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTvCastingCommon.a; path = lib/libTvCastingCommon.a; sourceTree = BUILT_PRODUCTS_DIR; };
59-
3CCB8736286A555500771BAD /* libmbedtls.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmbedtls.a; path = lib/libmbedtls.a; sourceTree = BUILT_PRODUCTS_DIR; };
6058
3CCB8739286A593700771BAD /* DiscoveredNodeData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiscoveredNodeData.mm; sourceTree = "<group>"; };
6159
3CCB873A286A593700771BAD /* CastingServerBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CastingServerBridge.h; sourceTree = "<group>"; };
6260
3CCB873B286A593700771BAD /* DiscoveredNodeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiscoveredNodeData.h; sourceTree = "<group>"; };
@@ -77,7 +75,6 @@
7775
buildActionMask = 2147483647;
7876
files = (
7977
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */,
80-
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */,
8178
);
8279
runOnlyForDeploymentPostprocessing = 0;
8380
};
@@ -88,7 +85,6 @@
8885
isa = PBXGroup;
8986
children = (
9087
3CCB871F2869085400771BAD /* MatterTvCastingBridge */,
91-
3CCB8736286A555500771BAD /* libmbedtls.a */,
9288
3CCB8735286A555500771BAD /* libTvCastingCommon.a */,
9389
3CCB871E2869085400771BAD /* Products */,
9490
);
@@ -312,7 +308,6 @@
312308
DEBUG_INFORMATION_FORMAT = dwarf;
313309
ENABLE_STRICT_OBJC_MSGSEND = YES;
314310
ENABLE_TESTABILITY = YES;
315-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
316311
GCC_C_LANGUAGE_STANDARD = gnu11;
317312
GCC_DYNAMIC_NO_PIC = NO;
318313
GCC_NO_COMMON_BLOCKS = YES;
@@ -400,6 +395,10 @@
400395
3CCB87252869085400771BAD /* Debug */ = {
401396
isa = XCBuildConfiguration;
402397
buildSettings = {
398+
"ARCHS[sdk=iphonesimulator*]" = (
399+
arm64,
400+
x86_64,
401+
);
403402
CHIP_ROOT = "$(PROJECT_DIR)/../../../..";
404403
CODE_SIGN_STYLE = Automatic;
405404
COPY_PHASE_STRIP = NO;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1430"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "3CCB871C2869085400771BAD"
18+
BuildableName = "MatterTvCastingBridge.framework"
19+
BlueprintName = "MatterTvCastingBridge"
20+
ReferencedContainer = "container:MatterTvCastingBridge.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
shouldAutocreateTestPlan = "YES">
31+
</TestAction>
32+
<LaunchAction
33+
buildConfiguration = "Debug"
34+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36+
launchStyle = "0"
37+
useCustomWorkingDirectory = "NO"
38+
ignoresPersistentStateOnLaunch = "NO"
39+
debugDocumentVersioning = "YES"
40+
debugServiceExtension = "internal"
41+
allowLocationSimulation = "YES">
42+
</LaunchAction>
43+
<ProfileAction
44+
buildConfiguration = "Release"
45+
shouldUseLaunchSchemeArgsEnv = "YES"
46+
savedToolIdentifier = ""
47+
useCustomWorkingDirectory = "NO"
48+
debugDocumentVersioning = "YES">
49+
<MacroExpansion>
50+
<BuildableReference
51+
BuildableIdentifier = "primary"
52+
BlueprintIdentifier = "3CCB871C2869085400771BAD"
53+
BuildableName = "MatterTvCastingBridge.framework"
54+
BlueprintName = "MatterTvCastingBridge"
55+
ReferencedContainer = "container:MatterTvCastingBridge.xcodeproj">
56+
</BuildableReference>
57+
</MacroExpansion>
58+
</ProfileAction>
59+
<AnalyzeAction
60+
buildConfiguration = "Debug">
61+
</AnalyzeAction>
62+
<ArchiveAction
63+
buildConfiguration = "Release"
64+
revealArchiveInOrganizer = "YES">
65+
</ArchiveAction>
66+
</Scheme>

examples/tv-casting-app/darwin/MatterTvCastingBridge/chip_xcode_build_connector.sh

+20-22
Original file line numberDiff line numberDiff line change
@@ -60,35 +60,31 @@ for define in "${defines[@]}"; do
6060
done
6161
target_defines=[${target_defines:1}]
6262

63+
declare target_arch=
6364
declare target_cpu=
64-
case $PLATFORM_PREFERRED_ARCH in
65-
i386)
66-
target_cpu=x86
67-
;;
68-
x86_64)
69-
target_cpu=x64
70-
;;
71-
armv7)
72-
target_cpu=arm
73-
;;
74-
arm64)
75-
target_cpu=arm64
76-
;;
77-
*)
78-
echo >&2
79-
;;
80-
esac
81-
82-
declare target_cflags='"-target","'"$PLATFORM_PREFERRED_ARCH"'-'"$LLVM_TARGET_TRIPLE_VENDOR"'-'"$LLVM_TARGET_TRIPLE_OS_VERSION"'"'
65+
declare target_cflags=
66+
declare current_arch="$(uname -m)"
8367

8468
read -r -a archs <<<"$ARCHS"
85-
8669
for arch in "${archs[@]}"; do
87-
target_cflags+=',"-arch","'"$arch"'"'
70+
if [ -z "$target_arch" ] || [ "$arch" = "$current_arch" ]; then
71+
target_arch="$arch"
72+
case "$arch" in
73+
x86_64) target_cpu="x64" ;;
74+
*) target_cpu="$arch" ;;
75+
esac
76+
fi
77+
if [ -n "$target_cflags" ]; then
78+
target_cflags+=','
79+
fi
80+
target_cflags+='"-arch","'"$arch"'"'
8881
done
8982

9083
[[ $ENABLE_BITCODE == YES ]] && {
91-
target_cflags+=',"-flto"'
84+
if [ -n "$target_cflags" ]; then
85+
target_cflags+=','
86+
fi
87+
target_cflags+='"-flto"'
9288
}
9389

9490
target_cflags+=',"-fno-c++-static-destructors"'
@@ -101,6 +97,8 @@ declare -a args=(
10197
'target_cpu="'"$target_cpu"'"'
10298
'target_defines='"$target_defines"
10399
'target_cflags=['"$target_cflags"']'
100+
"mac_target_arch=\"$target_arch\""
101+
"mac_deployment_target=\"$LLVM_TARGET_TRIPLE_OS_VERSION$LLVM_TARGET_TRIPLE_SUFFIX\""
104102
'build_tv_casting_common_a=true'
105103
)
106104

examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@
290290
DEBUG_INFORMATION_FORMAT = dwarf;
291291
ENABLE_STRICT_OBJC_MSGSEND = YES;
292292
ENABLE_TESTABILITY = YES;
293-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
294293
GCC_C_LANGUAGE_STANDARD = gnu11;
295294
GCC_DYNAMIC_NO_PIC = NO;
296295
GCC_NO_COMMON_BLOCKS = YES;
@@ -376,6 +375,10 @@
376375
3CC0E9052841DD3500EC6A18 /* Debug */ = {
377376
isa = XCBuildConfiguration;
378377
buildSettings = {
378+
"ARCHS[sdk=iphonesimulator*]" = (
379+
arm64,
380+
x86_64,
381+
);
379382
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
380383
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
381384
CLANG_ENABLE_MODULES = YES;

0 commit comments

Comments
 (0)