return result;
}
+static llvm::StringRef GetXcodeSDKDir(std::string preferred,
+ std::string secondary) {
+ llvm::StringRef sdk;
+ sdk = HostInfo::GetXcodeSDKPath(XcodeSDK(std::move(preferred)));
+ if (sdk.empty())
+ sdk = HostInfo::GetXcodeSDKPath(XcodeSDK(std::move(secondary)));
+ return sdk;
+}
+
PlatformSP PlatformAppleSimulator::CreateInstance(
const char *class_name, const char *description, ConstString plugin_name,
llvm::SmallVector<llvm::Triple::ArchType, 4> supported_arch,
llvm::Triple::OSType preferred_os,
llvm::SmallVector<llvm::Triple::OSType, 4> supported_os,
llvm::SmallVector<llvm::StringRef, 4> supported_triples,
- llvm::StringRef sdk, lldb_private::XcodeSDK::Type sdk_type,
+ std::string sdk_name_preferred, std::string sdk_name_secondary,
+ lldb_private::XcodeSDK::Type sdk_type,
CoreSimulatorSupport::DeviceType::ProductFamilyID kind, bool force,
const ArchSpec *arch) {
Log *log = GetLog(LLDBLog::Platform);
if (create) {
LLDB_LOGF(log, "%s::%s() creating platform", class_name, __FUNCTION__);
+ llvm::StringRef sdk =
+ GetXcodeSDKDir(sdk_name_preferred, sdk_name_secondary);
return PlatformSP(new PlatformAppleSimulator(
class_name, description, plugin_name, preferred_os, supported_triples,
sdk, sdk_type, kind));
!arch->TripleEnvironmentWasSpecified();
}
-static llvm::StringRef GetXcodeSDKDir(std::string preferred,
- std::string secondary) {
- llvm::StringRef sdk;
- sdk = HostInfo::GetXcodeSDKPath(XcodeSDK(std::move(preferred)));
- if (sdk.empty())
- sdk = HostInfo::GetXcodeSDKPath(XcodeSDK(std::move(secondary)));
- return sdk;
-}
-
static const char *g_ios_plugin_name = "ios-simulator";
static const char *g_ios_description = "iPhone simulator platform plug-in.";
static PlatformSP CreateInstance(bool force, const ArchSpec *arch) {
if (shouldSkipSimulatorPlatform(force, arch))
return nullptr;
- llvm::StringRef sdk;
- sdk = HostInfo::GetXcodeSDKPath(XcodeSDK("iPhoneSimulator.Internal.sdk"));
- if (sdk.empty())
- sdk = HostInfo::GetXcodeSDKPath(XcodeSDK("iPhoneSimulator.sdk"));
return PlatformAppleSimulator::CreateInstance(
"PlatformiOSSimulator", g_ios_description,
#endif
#endif
},
- GetXcodeSDKDir("iPhoneSimulator.Internal.sdk", "iPhoneSimulator.sdk"),
+ "iPhoneSimulator.Internal.sdk", "iPhoneSimulator.sdk",
XcodeSDK::Type::iPhoneSimulator,
CoreSimulatorSupport::DeviceType::ProductFamilyID::iPhone, force, arch);
}
#endif
#endif
},
- GetXcodeSDKDir("AppleTVSimulator.Internal.sdk", "AppleTVSimulator.sdk"),
+ "AppleTVSimulator.Internal.sdk", "AppleTVSimulator.sdk",
XcodeSDK::Type::AppleTVSimulator,
CoreSimulatorSupport::DeviceType::ProductFamilyID::appleTV, force,
arch);
#endif
#endif
},
- GetXcodeSDKDir("WatchSimulator.Internal.sdk", "WatchSimulator.sdk"),
+ "WatchSimulator.Internal.sdk", "WatchSimulator.sdk",
XcodeSDK::Type::WatchSimulator,
CoreSimulatorSupport::DeviceType::ProductFamilyID::appleWatch, force,
arch);