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

Method GetSystemName

Source/cmSystemTools.cxx:4325–4361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4323}
4324
4325cm::string_view cmSystemTools::GetSystemName()
4326{
4327#if defined(_WIN32)
4328 return "Windows";
4329#elif defined(__MSYS__)
4330 return "MSYS";
4331#elif defined(__CYGWIN__)
4332 return "CYGWIN";
4333#elif defined(__ANDROID__)
4334 return "Android";
4335#else
4336 static struct utsname uts_name;
4337 static bool initialized = false;
4338 static cm::string_view systemName;
4339 if (initialized) {
4340 return systemName;
4341 }
4342 if (uname(&uts_name) >= 0) {
4343 initialized = true;
4344 systemName = uts_name.sysname;
4345
4346 if (cmIsOff(systemName)) {
4347 systemName = "UnknownOS";
4348 }
4349
4350 // fix for BSD/OS, remove the /
4351 static cmsys::RegularExpression const bsdOsRegex("BSD.OS");
4352 cmsys::RegularExpressionMatch match;
4353 if (bsdOsRegex.find(uts_name.sysname, match)) {
4354 systemName = "BSDOS";
4355 }
4356
4357 return systemName;
4358 }
4359 return "";
4360#endif
4361}
4362
4363char cmSystemTools::GetSystemPathlistSeparator()
4364{

Callers 2

FindVCTargetsPathMethod · 0.80

Calls 2

cmIsOffFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected