Skip to content

Commit 68d4565

Browse files
iOS tv-casting-app: updating build settings to allow arm64 simulator builds
1 parent 1f078a8 commit 68d4565

File tree

3 files changed

+20
-28
lines changed

3 files changed

+20
-28
lines changed

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

-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;

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

-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;

0 commit comments

Comments
 (0)