@@ -676,6 +676,41 @@ struct PlatformAppleWatchSimulator {
676
676
}
677
677
};
678
678
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
+ };
679
714
680
715
static unsigned g_initialize_count = 0 ;
681
716
@@ -686,12 +721,14 @@ void PlatformAppleSimulator::Initialize() {
686
721
PlatformiOSSimulator::Initialize ();
687
722
PlatformAppleTVSimulator::Initialize ();
688
723
PlatformAppleWatchSimulator::Initialize ();
724
+ PlatformXRSimulator::Initialize ();
689
725
}
690
726
}
691
727
692
728
void PlatformAppleSimulator::Terminate () {
693
729
if (g_initialize_count > 0 )
694
730
if (--g_initialize_count == 0 ) {
731
+ PlatformXRSimulator::Terminate ();
695
732
PlatformAppleWatchSimulator::Terminate ();
696
733
PlatformAppleTVSimulator::Terminate ();
697
734
PlatformiOSSimulator::Terminate ();
0 commit comments