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
…builds
  • Loading branch information
sharadb-amazon committed Mar 25, 2024
1 parent 74b151e commit c45713f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
3C9437942B3B47A10096E5F4 /* MCErrorUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C9437932B3B47A10096E5F4 /* MCErrorUtils.mm */; };
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 @@ -146,7 +145,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 Down Expand Up @@ -178,7 +176,6 @@
buildActionMask = 2147483647;
files = (
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */,
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -223,7 +220,6 @@
isa = PBXGroup;
children = (
3CCB871F2869085400771BAD /* MatterTvCastingBridge */,
3CCB8736286A555500771BAD /* libmbedtls.a */,
3CCB8735286A555500771BAD /* libTvCastingCommon.a */,
3CCB871E2869085400771BAD /* Products */,
);
Expand Down Expand Up @@ -546,7 +542,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 @@ -634,6 +629,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
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 @@ -340,7 +340,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 @@ -426,6 +425,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 c45713f

Please sign in to comment.