我为 armv7、armv7s arm64 构建了一个 Xcode 项目。我lipo -info在生成的 .a 文件上运行:
fat文件中的架构:Release-iphoneos/libhlsl2glsl.a是:armv7 (cputype (12) cpusubtype (11)) (cputype (16777228) cpusubtype (0))
这是在告诉我什么?
它是显示cputype,cpusubtype您可以通过使用函数sysctl或syctlbyname. 有关定义的值,请参见 mach/machine.h:
对于cputype, 12 用于 ARM CPU
#define CPU_TYPE_ARM ((cpu_type_t) 12)
16777228(又名 0x100000C)适用于 ARM64 CPU:CPU_TYPE_ARM | CPU_ARCH_ABI64
#define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */
对于cpusubtype:
#define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11) /* Swift */
#define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0)