@@ -172,11 +172,15 @@ if (is_ios || is_mac) {
172172
173173 if (is_ios ) {
174174 sources += [
175- " objc/helpers/RTCCameraPreviewView.h" ,
176- " objc/helpers/RTCCameraPreviewView.m" ,
177175 " objc/helpers/UIDevice+RTCDevice.h" ,
178176 " objc/helpers/UIDevice+RTCDevice.mm" ,
179177 ]
178+ if (target_environment != " xrdevice" && target_environment != " xrsimulator" ) {
179+ sources += [
180+ " objc/helpers/RTCCameraPreviewView.h" ,
181+ " objc/helpers/RTCCameraPreviewView.m" ,
182+ ]
183+ }
180184 frameworks += [ " UIKit.framework" ]
181185 }
182186 }
@@ -274,11 +278,14 @@ if (is_ios || is_mac) {
274278 deps = [
275279 " :base_objc" ,
276280 " :helpers_objc" ,
277- " :metal_objc" ,
278281 " :opengl_objc" ,
279282 " :videocapture_objc" ,
280283 " :videoframebuffer_objc" ,
281284 ]
285+
286+ if (target_environment != " xrdevice" && target_environment != " xrsimulator" ) {
287+ deps += [ " :metal_objc" ]
288+ }
282289 }
283290
284291 rtc_library (" audio_device" ) {
@@ -625,7 +632,7 @@ if (is_ios || is_mac) {
625632 " Metal.framework" ,
626633 " MetalKit.framework" ,
627634 ]
628- if (is_ios || is_mac ) {
635+ if (( is_ios || is_mac ) && ! ( target_environment == " xrsimulator " || target_environment == " xrdevice " ) ) {
629636 sources += [
630637 " objc/components/renderer/metal/RTCMTLVideoView.h" ,
631638 " objc/components/renderer/metal/RTCMTLVideoView.m" ,
@@ -667,9 +674,13 @@ if (is_ios || is_mac) {
667674 sources = [
668675 " objc/components/capturer/RTCCameraVideoCapturer.h" ,
669676 " objc/components/capturer/RTCCameraVideoCapturer.m" ,
670- " objc/components/capturer/RTCFileVideoCapturer.h" ,
671- " objc/components/capturer/RTCFileVideoCapturer.m" ,
672677 ]
678+ if (target_environment != " xrdevice" && target_environment != " xrsimulator" ) {
679+ sources += [
680+ " objc/components/capturer/RTCFileVideoCapturer.h" ,
681+ " objc/components/capturer/RTCFileVideoCapturer.m" ,
682+ ]
683+ }
673684 frameworks = [
674685 " AVFoundation.framework" ,
675686 " CoreVideo.framework" ,
@@ -687,7 +698,7 @@ if (is_ios || is_mac) {
687698 " ../rtc_base/system:gcd_helpers" ,
688699 ]
689700 }
690-
701+
691702 rtc_library (" desktopcapture_objc" ) {
692703 visibility = [ " *" ]
693704 sources = [
@@ -705,7 +716,7 @@ if (is_ios || is_mac) {
705716 " objc/native/src/objc_desktop_media_list.h" ,
706717 " objc/native/src/objc_desktop_media_list.mm" ,
707718 ]
708- frameworks = [
719+ frameworks = [
709720 " AppKit.framework" ,
710721 ]
711722
@@ -720,7 +731,7 @@ if (is_ios || is_mac) {
720731 " ../rtc_base/system:gcd_helpers" ,
721732 " ../modules/desktop_capture" ,
722733 ]
723- if (is_mac ) {
734+ if (is_mac ) {
724735 deps += [ " //third_party:jpeg" , ]
725736 }
726737 }
@@ -879,7 +890,7 @@ if (is_ios || is_mac) {
879890 " ../media:rtc_simulcast_encoder_adapter" ,
880891 ]
881892 }
882-
893+
883894 rtc_library (" mediaconstraints_objc" ) {
884895 configs += [ " ..:no_global_constructors" ]
885896 sources = [
@@ -1242,7 +1253,6 @@ if (is_ios || is_mac) {
12421253 " :framework_objc" ,
12431254 " :helpers_objc" ,
12441255 " :mediaconstraints_objc" ,
1245- " :metal_objc" ,
12461256 " :native_api" ,
12471257 " :native_api_audio_device_module" ,
12481258 " :native_video" ,
@@ -1275,7 +1285,11 @@ if (is_ios || is_mac) {
12751285 " ../system_wrappers" ,
12761286 " //third_party/libyuv" ,
12771287 ]
1278-
1288+ if (target_environment != " xrdevice" && target_environment != " xrsimulator" ) {
1289+ deps += [
1290+ " :metal_objc" ,
1291+ ]
1292+ }
12791293 if (rtc_ios_use_opengl_rendering ) {
12801294 deps += [ " :opengl_objc" ]
12811295 }
@@ -1375,7 +1389,6 @@ if (is_ios || is_mac) {
13751389 " objc/components/capturer/RTCCameraVideoCapturer.h" ,
13761390 " objc/components/capturer/RTCFileVideoCapturer.h" ,
13771391 " objc/components/network/RTCNetworkMonitor.h" ,
1378- " objc/components/renderer/metal/RTCMTLVideoView.h" ,
13791392 " objc/components/renderer/opengl/RTCEAGLVideoView.h" ,
13801393 " objc/components/renderer/opengl/RTCVideoViewShading.h" ,
13811394 " objc/components/video_codec/RTCCodecSpecificInfoH264.h" ,
@@ -1387,7 +1400,6 @@ if (is_ios || is_mac) {
13871400 " objc/components/video_codec/RTCVideoEncoderFactoryH264.h" ,
13881401 " objc/components/video_codec/RTCVideoEncoderH264.h" ,
13891402 " objc/components/video_frame_buffer/RTCCVPixelBuffer.h" ,
1390- " objc/helpers/RTCCameraPreviewView.h" ,
13911403 " objc/helpers/RTCDispatcher.h" ,
13921404 " objc/helpers/RTCYUVHelper.h" ,
13931405 " objc/helpers/UIDevice+RTCDevice.h" ,
@@ -1452,6 +1464,13 @@ if (is_ios || is_mac) {
14521464 " objc/components/audio/RTCAudioCustomProcessingDelegate.h" ,
14531465 ]
14541466
1467+ if (target_environment != " xrdevice" && target_environment != " xrsimulator" ) {
1468+ common_objc_headers += [
1469+ " objc/helpers/RTCCameraPreviewView.h" ,
1470+ " objc/components/renderer/metal/RTCMTLVideoView.h" ,
1471+ ]
1472+ }
1473+
14551474 if (! build_with_chromium ) {
14561475 common_objc_headers += [
14571476 " objc/api/logging/RTCCallbackLogger.h" ,
@@ -1472,7 +1491,6 @@ if (is_ios || is_mac) {
14721491 " :audio_objc" ,
14731492 " :base_objc" ,
14741493 " :default_codec_factory_objc" ,
1475- " :metal_objc" ,
14761494 " :native_api" ,
14771495 " :native_video" ,
14781496 " :peerconnectionfactory_base_objc" ,
@@ -1481,6 +1499,9 @@ if (is_ios || is_mac) {
14811499 " :videotoolbox_objc" ,
14821500 " :darwin_privacy_info" ,
14831501 ]
1502+ if (target_environment != " xrdevice" && target_environment != " xrsimulator" ) {
1503+ deps += [ " :metal_objc" ]
1504+ }
14841505 if (! build_with_chromium ) {
14851506 deps += [
14861507 " :callback_logger_objc" ,
@@ -1626,7 +1647,6 @@ if (is_ios || is_mac) {
16261647 deps = [
16271648 " :base_objc" ,
16281649 " :default_codec_factory_objc" ,
1629- " :metal_objc" ,
16301650 " :native_api" ,
16311651 " :native_video" ,
16321652 " :peerconnectionfactory_base_objc" ,
@@ -1636,6 +1656,9 @@ if (is_ios || is_mac) {
16361656 " :videotoolbox_objc" ,
16371657 " :darwin_privacy_info" ,
16381658 ]
1659+ if (target_environment != " xrdevice" && target_environment != " xrsimulator" ) {
1660+ deps += [ " :metal_objc" ]
1661+ }
16391662 if (! build_with_chromium ) {
16401663 deps += [
16411664 " :callback_logger_objc" ,
0 commit comments