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

Method GetArchitectures

Source/cmMachO.cxx:370–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370cmMachO::StringList cmMachO::GetArchitectures() const
371{
372 cmMachO::StringList archs;
373 if (Valid() && !this->Headers.empty()) {
374 for (auto const& header : this->Headers) {
375 char const* archName = "unknown";
376#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 130000
377 if (__builtin_available(macOS 13.0, *)) {
378 archName = (header.CpuType & CPU_TYPE_ARM)
379 ? macho_arch_name_for_cpu_type(header.CpuType, header.CpuSubType)
380 : macho_arch_name_for_cpu_type(header.CpuType, CPU_SUBTYPE_MULTIPLE);
381 } else
382#endif
383 {
384#if defined __clang__
385# define CM_MACOS_DEPRECATED_NXGetArchInfoFromCpuType
386# pragma clang diagnostic push
387# pragma clang diagnostic ignored "-Wdeprecated-declarations"
388#endif
389 NXArchInfo const* archInfo = (header.CpuType & CPU_TYPE_ARM)
390 ? NXGetArchInfoFromCpuType(header.CpuType, header.CpuSubType)
391 : NXGetArchInfoFromCpuType(header.CpuType, CPU_SUBTYPE_MULTIPLE);
392#ifdef CM_MACOS_DEPRECATED_NXGetArchInfoFromCpuType
393# undef CM_MACOS_DEPRECATED_NXGetArchInfoFromCpuType
394# pragma clang diagnostic pop
395#endif
396 if (archInfo) {
397 archName = archInfo->name;
398 }
399 }
400 archs.push_back(archName);
401 }
402 }
403 return archs;
404}

Callers 1

HandleReadMachoCommandFunction · 0.80

Calls 2

push_backMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected