What targets are available for the swiftc -target and -target-cpu option? What targets are available for the swiftc -target and -target-cpu option? swift swift

What targets are available for the swiftc -target and -target-cpu option?


If you look at Swift repository on Github (Exact location: swift/utils/swift_build_support/swift_build_support/targets.py) You will see all host targets at line 149-192 in target.py.

Supports:

def host_target():    """    Return the host target for the build machine, if it is one of    the recognized targets. Otherwise, throw a NotImplementedError.    """    system = platform.system()    machine = platform.machine()    if system == 'Linux':        if machine == 'x86_64':            return StdlibDeploymentTarget.Linux.x86_64        elif machine.startswith('armv7'):            # linux-armv7* is canonicalized to 'linux-armv7'            return StdlibDeploymentTarget.Linux.armv7        elif machine.startswith('armv6'):            # linux-armv6* is canonicalized to 'linux-armv6'            return StdlibDeploymentTarget.Linux.armv6        elif machine == 'aarch64':            return StdlibDeploymentTarget.Linux.aarch64        elif machine == 'ppc64':            return StdlibDeploymentTarget.Linux.powerpc64        elif machine == 'ppc64le':            return StdlibDeploymentTarget.Linux.powerpc64le        elif machine == 's390x':            return StdlibDeploymentTarget.Linux.s390x    elif system == 'Darwin':        if machine == 'x86_64':            return StdlibDeploymentTarget.OSX.x86_64    elif system == 'FreeBSD':        if machine == 'amd64':            return StdlibDeploymentTarget.FreeBSD.x86_64    elif system == 'CYGWIN_NT-10.0':        if machine == 'x86_64':            return StdlibDeploymentTarget.Cygwin.x86_64    elif system == 'Windows':        if machine == "AMD64":            return StdlibDeploymentTarget.Windows.x86_64    raise NotImplementedError('System "%s" with architecture "%s" is not '                              'supported' % (system, machine))