MCPcopy Create free account
hub / github.com/Kitware/CMake / GetAppleSpecificPlatformName

Method GetAppleSpecificPlatformName

Source/cmGlobalXCodeGenerator.cxx:298–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298std::string cmGlobalXCodeGenerator::GetAppleSpecificPlatformName()
299{
300 std::string sdkRoot =
301 this->GetCMakeInstance()->GetState()->GetCacheEntryValue(
302 "CMAKE_OSX_SYSROOT");
303 sdkRoot = cmSystemTools::LowerCase(sdkRoot);
304
305 struct SdkDatabaseEntry
306 {
307 cm::string_view Name;
308 cm::string_view AppleName;
309 };
310
311 std::array<SdkDatabaseEntry, 6> const sdkDatabase{ {
312 { "appletvos"_s, "tvOS"_s },
313 { "appletvsimulator"_s, "tvOS Simulator"_s },
314 { "iphoneos"_s, "iOS"_s },
315 { "iphonesimulator"_s, "iOS Simulator"_s },
316 { "watchos"_s, "watchOS"_s },
317 { "watchsimulator"_s, "watchOS Simulator"_s },
318 } };
319
320 cm::string_view platformName = "MacOS"_s;
321 for (SdkDatabaseEntry const& entry : sdkDatabase) {
322 if (cmHasPrefix(sdkRoot, entry.Name) ||
323 sdkRoot.find(cmStrCat('/', entry.Name)) != std::string::npos) {
324 platformName = entry.AppleName;
325 break;
326 }
327 }
328
329 return std::string(platformName);
330}
331
332std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand()
333{

Callers 1

GenerateBuildCommandMethod · 0.95

Calls 6

cmHasPrefixFunction · 0.85
cmStrCatFunction · 0.70
GetCacheEntryValueMethod · 0.45
GetStateMethod · 0.45
GetCMakeInstanceMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected