diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj index f55ca2b5242b20..c7216956b406dd 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj @@ -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 */; }; @@ -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 = ""; }; 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 = ""; }; 3CCB873A286A593700771BAD /* CastingServerBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CastingServerBridge.h; sourceTree = ""; }; 3CCB873B286A593700771BAD /* DiscoveredNodeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiscoveredNodeData.h; sourceTree = ""; }; @@ -178,7 +176,6 @@ buildActionMask = 2147483647; files = ( 3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */, - 3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -223,7 +220,6 @@ isa = PBXGroup; children = ( 3CCB871F2869085400771BAD /* MatterTvCastingBridge */, - 3CCB8736286A555500771BAD /* libmbedtls.a */, 3CCB8735286A555500771BAD /* libTvCastingCommon.a */, 3CCB871E2869085400771BAD /* Products */, ); @@ -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; @@ -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; diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/chip_xcode_build_connector.sh b/examples/tv-casting-app/darwin/MatterTvCastingBridge/chip_xcode_build_connector.sh index cd34f87cf80d78..1c5d3bd7e6384f 100755 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/chip_xcode_build_connector.sh +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/chip_xcode_build_connector.sh @@ -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"' @@ -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' ) diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj index e7005121a06352..e48185f4c9d64c 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj @@ -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; @@ -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;