@@ -676,6 +676,41 @@ struct PlatformAppleWatchSimulator {
676676 }
677677};
678678
679+ static const char *g_xros_plugin_name = " xros-simulator" ;
680+ static const char *g_xros_description = " XROS simulator platform plug-in." ;
681+
682+ // / XRSimulator Plugin.
683+ struct PlatformXRSimulator {
684+ static void Initialize () {
685+ PluginManager::RegisterPlugin (g_xros_plugin_name, g_xros_description,
686+ PlatformXRSimulator::CreateInstance);
687+ }
688+
689+ static void Terminate () {
690+ PluginManager::UnregisterPlugin (PlatformXRSimulator::CreateInstance);
691+ }
692+
693+ static PlatformSP CreateInstance (bool force, const ArchSpec *arch) {
694+ return PlatformAppleSimulator::CreateInstance (
695+ " PlatformXRSimulator" , g_xros_description,
696+ ConstString (g_xros_plugin_name),
697+ {llvm::Triple::aarch64, llvm::Triple::x86_64, llvm::Triple::x86},
698+ llvm::Triple::XROS, {llvm::Triple::XROS},
699+ {
700+ #ifdef __APPLE__
701+ #if __arm64__
702+ " arm64e-apple-xros-simulator" , " arm64-apple-xros-simulator" ,
703+ #else
704+ " x86_64-apple-xros-simulator" , " x86_64h-apple-xros-simulator" ,
705+ #endif
706+ #endif
707+ },
708+ " XRSimulator.Internal.sdk" , " XRSimulator.sdk" ,
709+ XcodeSDK::Type::XRSimulator,
710+ CoreSimulatorSupport::DeviceType::ProductFamilyID::appleXR, force,
711+ arch);
712+ }
713+ };
679714
680715static unsigned g_initialize_count = 0 ;
681716
@@ -686,12 +721,14 @@ void PlatformAppleSimulator::Initialize() {
686721 PlatformiOSSimulator::Initialize ();
687722 PlatformAppleTVSimulator::Initialize ();
688723 PlatformAppleWatchSimulator::Initialize ();
724+ PlatformXRSimulator::Initialize ();
689725 }
690726}
691727
692728void PlatformAppleSimulator::Terminate () {
693729 if (g_initialize_count > 0 )
694730 if (--g_initialize_count == 0 ) {
731+ PlatformXRSimulator::Terminate ();
695732 PlatformAppleWatchSimulator::Terminate ();
696733 PlatformAppleTVSimulator::Terminate ();
697734 PlatformiOSSimulator::Terminate ();
0 commit comments